window.gapi = { load: function(){} };
window.FB = { init: function(){} };

@font-face {
    font-family: "Tiki";
    src: url("/assets/TikiTropic.ttf");
    unicode-range: U+0000-007F;
}

@font-face {
    font-family: "Tiki";
    src: url("/assets/ObelixPro.woff2");
    font-size-adjust: 0.4;
    unicode-range: U+0400-04FF;
}

@font-face {
    font-family: "South Africa";
    src: url("/assets/afrikas.woff");
    unicode-range: U+0000-007F;
}

@font-face {
    font-family: "South Africa";
    src: url("/assets/ObelixPro.woff2");
    font-size-adjust: 0.88;
    unicode-range: U+0400-04FF;
}

.arial,
.arrow-btn {
    font-family: 'Open Sans', sans-serif;
    font-weight: bold;
    margin-top: -0.2em;
}

body {
    margin: 0;
    padding: 0;
    border: 0;
    background-color: #000;
    background-image: url("assets/texture3c.webp");
    
    /* Добавь эти строки: */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    word-spacing: 0.5ch;
    font-family: "South Africa";
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

ul {
    padding: 0;
    margin: 0;
    padding-left: 1ch;
}

h1,
h2,
h3,
h4 {
    margin: 10px 0;
}

h3 {
    font-size: 1.33em;
}

div,
input,
input::placeholder {
    color: #3a3836;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: transparent;
}

a,
a:hover,
a:active,
a:visited {
    color: #3a3836;
    text-decoration: none;
}

input:hover,
textarea:hover,
input:hover::placeholder {
    color: #6a6764;
}

input,
textarea {
    text-align: center;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    border: 3px solid #a5640a;
    padding-top: 0.2em;
    border-radius: 12px;
    width: 15ch;
    user-select: auto;
}

input:focus {
    outline: 0;
}

.column {
    flex-direction: column;
}

.hidden {
    display: none;
}

.panel {
    background: linear-gradient(to bottom left, #f9e5bd, #f8daa5);
    padding: 20px;
    border-radius: 20px;
    border: 3px solid #a5640a;
    margin: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.screen {
    position: relative;
    top: -7vh;
}

.two-column {
    flex: 100%;
}

.align-left {
    align-items: flex-start;
}

.ad-container {
    flex-direction: column;
    padding: 0.5em 1ch 1em;
    min-width: 320px;
    min-height: 278px;
}

.advertisementText {
    font-size: 0.7rem;
}

.ad-placeholder {
    background-color: #00008b;
    background-image: url("assets/ad-placeholder.jpg");
    width: 300px;
    height: 600px;
    position: fixed;
    right: 0;
}

.ad-placeholder-small {
    background-color: #00008b;
    background-image: url("assets/ad-placeholder-small.png");
    width: 300px;
    height: 250px;
}

#view-container {
    height: 100vh;
    align-items: flex-end;
    background-color: #6ca6e6;
    background-image: url("assets/background03.png");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    position: relative;
}

#controls-container {
    position: fixed;
    bottom: 0;
    left: 0;
}

.btn,
.main-menu-btn,
.back-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1px 0;
    cursor: pointer;
    transition: transform 0.1s, filter 0.1s;
}

#share-section {
    transition: transform 0.1s ease-out;
}

.highlighted {
    transform: scale(1.1);
}

.btn {
    font-size: 1.1rem;
    word-spacing: initial;
}

.back-btn,
.btn {
    color: #3d2403;
    background-color: #d6b583;
    border: 3px solid #5a2704;
    border-radius: 12px;
    padding: 5px 8px 2px;
    margin: 2px;
    white-space: nowrap;
}

.back-btn:hover,
.btn:hover {
    filter: brightness(1.75);
}

.back-btn:active,
.btn:active {
    transform: scale(0.9);
}

.back-btn {
    position: absolute;
    left: 0.5ch;
    top: 1.3em;
    border-radius: 50%;
    background-image: url("assets/back.png");
    background-repeat: no-repeat;
    background-size: 1em;
    background-position: 0.18em 0.1em;
    width: 1.8em;
    height: 1.8em;
}

.keyboard-btn,
.chat-btn {
    color: #312f2c;
    border-radius: 0.4em;
    background-color: #c8c1b5;
    font-size: 0.75em;
    height: 1.8em;
    width: 1.8em;
    padding: 0.2em 0 0 0;
    border: 3px solid #747069;
    margin: 0.1em 0;
}

.arrow-btn {
    height: 1.4em;
    width: 1.4em;
    margin: 0 0.1ch;
    vertical-align: middle;
}

#login-google,
#login-facebook {
    padding-left: calc(8px + 1.3em);
    background-size: 1.3em;
    background-repeat: no-repeat;
    background-position: 3px 2.5px;
}

#login-google {
    background-image: url("assets/google-icon.png");
}

#login-facebook {
    background-image: url("assets/facebook.png");
}

.main-menu-btn {
    padding: 0 calc(1.3rem + 0.33ch);
    font-size: 1.3rem;
}

.main-menu-btn-selected {
    transform: scale(1.3);
    background-image: url("assets/ball2.png");
    background-repeat: no-repeat;
    background-size: 1.2rem;
    color: #00f;
}

.main-menu-btn-active {
    transform: scale(1);
}

#gui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
}

#border-left,
#border-right {
    position: absolute;
    bottom: 0;
}

th,
td {
    padding: 5px 0.5ch;
    word-spacing: normal;
}

th {
    font-size: 0.8rem;
    font-weight: normal;
}

td {
    border-top: 1px solid #a49a8a;
}

.highscores-placement {
    text-align: right;
}

.highscores-self {
    color: #008000;
    font-weight: bold;
}

.highscores-image-cell {
    padding: 3px;
}

.highscores-image {
    width: 2em;
    height: 2em;
    border-radius: 50%;
    border: 1px solid #beb097;
    background-size: 3.5em;
    background-position: -1.25em -0.5em;
}

.highscores-name {
    font-size: 1.1rem;
    width: 12ch;
}

.highscores-name,
.highscores-level,
.highscores-wins,
.highscores-matches {
    text-align: center;
}

.highscores-playtime {
    text-align: right;
    font-size: 0.8rem;
    text-align: right;
}

.left-wins,
.right-wins {
    font-size: 0.6em;
}

#opponent-level-right,
#opponent-level-left {
    font-size: 0.85em;
    word-spacing: initial;
}

.sound-btn,
#logout {
    background-size: cover;
    background-repeat: no-repeat;
    width: 1.5em;
    height: 1.5em;
    cursor: pointer;
    transition: transform 0.1s;
}

.sound-btn:hover,
#logout:hover {
    transform: scale(1.3);
}

.sound-btn:active,
#logout:active {
    transform: scale(1);
}

#logout {
    background-image: url("assets/logout.png");
}

#region-btn {
    width: 5ch;
    padding: 0.3em 0.5ch 0.1em;
    font-size: 0.8em;
}

.footer-elem,
.credits-elem {
    margin: 0 1.5ch;
}

.footer-elem div,
.credits-elem div {
    margin-bottom: 0.05em;
    font-size: 0.8em;
    margin-right: 1ch;
}

.footer-elem a,
.credits-elem a {
    transition: transform 0.1s;
}

.footer-elem a:hover,
.credits-elem a:hover {
    transform: scale(1.1);
}

.footer-elem a:active,
.credits-elem a:active {
    transform: scale(1);
}

#credits-link {
    transition: transform 0.1s;
}

#credits-link:hover {
    transform: scale(1.1);
}

#credits-link:active {
    transform: scale(1);
}

.credits-elem {
    margin-top: 0.5em;
}

.footer {
    padding: 0.6em 0 0.4em;
    border-radius: 14px;
    font-size: 0.8em;
    word-spacing: 0;
    margin: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 0;
}

li {
    margin: 0.2em 0;
}

.chest-container,
#chest {
    width: calc(308px * 0.7);
    height: calc(196px * 0.7);
}

#chest {
    background-image: url("assets/chest.png");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.1s;
    cursor: pointer;
}

#chest:hover {
    transform: scale(1.1);
}

#chest:active {
    transform: scale(1);
}

.chest-shaking {
    animation-name: chest-shake;
    animation-duration: 0.6s;
    transform-origin: center;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

#news {
    padding: 1em 1ch;
    white-space: normal;
    width: 320px;
    font-size: 0.7em;
}

#news h3 {
    font-size: 1.1em;
}

#news ul {
    flex-shrink: 0;
}

#news h2 {
    align-self: center;
    font-size: 1.3rem;
    margin: 0;
}

.scrollable {
    justify-content: flex-start;
    align-items: flex-start;
    overflow-y: scroll;
    max-height: 300px;
}

.scrollable::-webkit-scrollbar {
    width: 12px;
    border-radius: 6px;
    background: #c8c1b5;
}

.scrollable::-webkit-scrollbar-thumb {
    border-radius: 6px;
    background-color: #747069;
}

.coinIcon {
    width: 1.3em;
    height: 1.3em;
    background-image: url("assets/textures/coin.png");
    background-size: contain;
    margin-left: 0.2ch;
    margin-top: -0.2em;
}

.locked-item {
    width: 45%;
    height: 45%;
    background-image: url("assets/lock.png");
    background-size: contain;
    position: absolute;
    bottom: 5%;
    left: 0;
}

@-moz-keyframes chest-shake {
    0% {
        transform: translate(2%, 1%) rotate(0deg);
    }
    10% {
        transform: translate(-1%, -2%) rotate(-1deg);
    }
    20% {
        transform: translate(-3%, 0%) rotate(1deg);
    }
    30% {
        transform: translate(0%, 2%) rotate(0deg);
    }
    40% {
        transform: translate(1%, -1%) rotate(1deg);
    }
    50% {
        transform: translate(-1%, 2%) rotate(-1deg);
    }
    60% {
        transform: translate(-3%, 1%) rotate(0deg);
    }
    70% {
        transform: translate(2%, 1%) rotate(-1deg);
    }
    80% {
        transform: translate(-1%, -1%) rotate(1deg);
    }
    90% {
        transform: translate(2%, 2%) rotate(0deg);
    }
    100% {
        transform: translate(1%, -2%) rotate(-1deg);
    }
}

@-webkit-keyframes chest-shake {
    0% {
        transform: translate(2%, 1%) rotate(0deg);
    }
    10% {
        transform: translate(-1%, -2%) rotate(-1deg);
    }
    20% {
        transform: translate(-3%, 0%) rotate(1deg);
    }
    30% {
        transform: translate(0%, 2%) rotate(0deg);
    }
    40% {
        transform: translate(1%, -1%) rotate(1deg);
    }
    50% {
        transform: translate(-1%, 2%) rotate(-1deg);
    }
    60% {
        transform: translate(-3%, 1%) rotate(0deg);
    }
    70% {
        transform: translate(2%, 1%) rotate(-1deg);
    }
    80% {
        transform: translate(-1%, -1%) rotate(1deg);
    }
    90% {
        transform: translate(2%, 2%) rotate(0deg);
    }
    100% {
        transform: translate(1%, -2%) rotate(-1deg);
    }
}

@-o-keyframes chest-shake {
    0% {
        transform: translate(2%, 1%) rotate(0deg);
    }
    10% {
        transform: translate(-1%, -2%) rotate(-1deg);
    }
    20% {
        transform: translate(-3%, 0%) rotate(1deg);
    }
    30% {
        transform: translate(0%, 2%) rotate(0deg);
    }
    40% {
        transform: translate(1%, -1%) rotate(1deg);
    }
    50% {
        transform: translate(-1%, 2%) rotate(-1deg);
    }
    60% {
        transform: translate(-3%, 1%) rotate(0deg);
    }
    70% {
        transform: translate(2%, 1%) rotate(-1deg);
    }
    80% {
        transform: translate(-1%, -1%) rotate(1deg);
    }
    90% {
        transform: translate(2%, 2%) rotate(0deg);
    }
    100% {
        transform: translate(1%, -2%) rotate(-1deg);
    }
}

@keyframes chest-shake {
    0% {
        transform: translate(2%, 1%) rotate(0deg);
    }
    10% {
        transform: translate(-1%, -2%) rotate(-1deg);
    }
    20% {
        transform: translate(-3%, 0%) rotate(1deg);
    }
    30% {
        transform: translate(0%, 2%) rotate(0deg);
    }
    40% {
        transform: translate(1%, -1%) rotate(1deg);
    }
    50% {
        transform: translate(-1%, 2%) rotate(-1deg);
    }
    60% {
        transform: translate(-3%, 1%) rotate(0deg);
    }
    70% {
        transform: translate(2%, 1%) rotate(-1deg);
    }
    80% {
        transform: translate(-1%, -1%) rotate(1deg);
    }
    90% {
        transform: translate(2%, 2%) rotate(0deg);
    }
    100% {
        transform: translate(1%, -2%) rotate(-1deg);
    }
}

#hud-container {
    position: fixed;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: flex-start;
}

#hud {
    align-items: center;
}

.hud-separator {
    margin: 10px;
    align-items: center;
}

.hud-half {
    min-width: 200px;
    justify-content: space-between;
    align-items: center;
}

.ball-container {
    position: relative;
    margin: 6px;
    width: 64px;
    height: 64px;
    cursor: pointer;
    background-color: #d6b583;
    border: 3px solid #85817c;
    border-radius: 6px;
    transition: transform 0.1s, border-color 0.2s;
}

.ball-container:hover {
    border-color: #fff;
}

.ball-container:active {
    transform: scale(0.9);
}

.ball {
    width: 95%;
    height: 95%;
    background-size: contain;
    background-repeat: no-repeat;
}

.ballSelected {
    transform: scale(1.15);
    border-color: #5a2704;
}

.opponent-preview-container,
.characterItem {
    position: relative;
    overflow: hidden;
    margin: 6px;
    width: 64px;
    height: 64px;
    cursor: pointer;
    background-color: #d6b583;
    border: 3px solid #85817c;
    border-radius: 6px;
    transition: transform 0.1s, border-color 0.2s;
}

.characterItem:hover {
    border-color: #fff;
}

.characterSelected {
    transform: scale(1.15);
    border-color: #5a2704;
}

.characterItem:active {
    transform: scale(0.9);
}

.character-p1 {
    border-color: #008000;
}

.character-p2 {
    border-color: #00f;
}

.character-both {
    border-top-color: #008000;
    border-left-color: #008000;
    border-bottom-color: #00f;
    border-right-color: #00f;
}

.character-frozen {
    filter: grayscale(100%);
}

.characterMark {
    font-family: 'Tiki';
    font-size: 62px;
    margin-bottom: 14px;
}

.opponent-preview-container {
    margin: 0;
    width: 80px;
    height: 80px;
    cursor: unset;
    border-color: #5a2704;
}

#opponent-preview-1,
#opponent-preview-2,
.characterImage {
    width: 180%;       /* Оставляем персонажей крупными */
    height: auto;
    margin-left: -60%;  /* Сдвигаем влево, чтобы показать правую часть (лицо) */
    margin-top: 15%;   /* Центрируем по вертикали */
    filter: drop-shadow(0 0 0 #000);
    flex-shrink: 0;
}

#player-name {
    font-size: 1.33rem;
    font-weight: bold;
}

.stats-elem {
    margin: 5px 10px;
    font-weight: bold;
    font-size: 1.1em;
    letter-spacing: 0.05ch;
    word-spacing: -0.2ch;
}

.progress-bar {
    border: 3px solid #3a3836;
    border-radius: 9px;
    width: 100%;
    font-size: 0.9em;
    padding: 3px 0 0px;
    color: #3a3836;
    background-size: 200%;
    margin: 2px 0;
}

#opponent-name-1,
#opponent-name-2 {
    font-size: 1.5rem;
}

.end-match-score {
    width: 150px;
    justify-content: space-between;
}

.share-button {
    height: 1.5em;
    margin: -0.2em 0.2ch 0 -0.35ch;
}

.preload-container {
    margin: 0.3em 0.5ch;
    position: relative;
    height: 3.3em;
    align-items: flex-start;
}

.preload-ball {
    width: 1.3em;
    height: 1.3em;
    background-image: url("assets/ball2.png");
    background-size: contain;
    -webkit-animation: preload-animation 1s linear infinite;
    animation: preload-animation 1s linear infinite;
}

.preload-shadow {
    position: absolute;
    bottom: 0;
    width: 1.3em;
    height: calc(1.3em / 5);
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.502);
    -webkit-animation: preload-shadow-animation 1s linear infinite;
    animation: preload-shadow-animation 1s linear infinite;
}

@-moz-keyframes preload-animation {
    0%,
    100% {
        animation-timing-function: cubic-bezier(0.45, 0, 0.9, 0.55);
    }
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
    50% {
        -webkit-transform: translate(0, 2em);
        transform: translate(0, 2em);
        animation-timing-function: cubic-bezier(0, 0.45, 0.55, 0.9);
    }
    100% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
}

@-webkit-keyframes preload-animation {
    0%,
    100% {
        animation-timing-function: cubic-bezier(0.45, 0, 0.9, 0.55);
    }
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
    50% {
        -webkit-transform: translate(0, 2em);
        transform: translate(0, 2em);
        animation-timing-function: cubic-bezier(0, 0.45, 0.55, 0.9);
    }
    100% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
}

@-o-keyframes preload-animation {
    0%,
    100% {
        animation-timing-function: cubic-bezier(0.45, 0, 0.9, 0.55);
    }
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
    50% {
        -webkit-transform: translate(0, 2em);
        transform: translate(0, 2em);
        animation-timing-function: cubic-bezier(0, 0.45, 0.55, 0.9);
    }
    100% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
}

@keyframes preload-animation {
    0%,
    100% {
        animation-timing-function: cubic-bezier(0.45, 0, 0.9, 0.55);
    }
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
    50% {
        -webkit-transform: translate(0, 2em);
        transform: translate(0, 2em);
        animation-timing-function: cubic-bezier(0, 0.45, 0.55, 0.9);
    }
    100% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
}

@-moz-keyframes preload-shadow-animation {
    0%,
    100% {
        animation-timing-function: cubic-bezier(0.45, 0, 0.9, 0.55);
    }
    0% {
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
    }
    50% {
        -webkit-transform: scale(1, 1);
        transform: scale(1, 1);
        animation-timing-function: cubic-bezier(0, 0.45, 0.55, 0.9);
    }
    100% {
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
    }
}

@-webkit-keyframes preload-shadow-animation {
    0%,
    100% {
        animation-timing-function: cubic-bezier(0.45, 0, 0.9, 0.55);
    }
    0% {
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
    }
    50% {
        -webkit-transform: scale(1, 1);
        transform: scale(1, 1);
        animation-timing-function: cubic-bezier(0, 0.45, 0.55, 0.9);
    }
    100% {
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
    }
}

@-o-keyframes preload-shadow-animation {
    0%,
    100% {
        animation-timing-function: cubic-bezier(0.45, 0, 0.9, 0.55);
    }
    0% {
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
    }
    50% {
        -webkit-transform: scale(1, 1);
        transform: scale(1, 1);
        animation-timing-function: cubic-bezier(0, 0.45, 0.55, 0.9);
    }
    100% {
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
    }
}

@keyframes preload-shadow-animation {
    0%,
    100% {
        animation-timing-function: cubic-bezier(0.45, 0, 0.9, 0.55);
    }
    0% {
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
    }
    50% {
        -webkit-transform: scale(1, 1);
        transform: scale(1, 1);
        animation-timing-function: cubic-bezier(0, 0.45, 0.55, 0.9);
    }
    100% {
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
    }
}

.chat-btn {
    font-size: 1.3rem;
}

.chat-label {
    margin: 0 0.5ch;
    border-radius: 20px;
    padding: 0.4em 0.5ch 0.2em;
}

/*# sourceMappingURL=main.css.map */

/* ===== Loadout modal + profile card ===== */
#character-screen {
    position: relative;
    align-items: flex-start;
}

#loadout-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 30;
}

#loadout-modal {
    width: min(960px, calc(100vw - 60px));
    max-height: calc(100vh - 70px);
    padding: 18px;
    overflow: auto;
    box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}

.loadout-modal-header {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 12px;
}

.loadout-modal-body {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
}

.loadout-modal-actions {
    width: 100%;
    margin-top: 8px;
    justify-content: flex-end;
    gap: 10px;
}

.loadout-close-btn {
    min-width: 2.4em;
}

#player-profile-card {
    min-width: 320px;
    align-items: stretch;
    gap: 12px;
    padding: 18px;
}

.player-profile-card-top {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}

.player-profile-avatar-wrap {
    width: 86px;
    height: 86px;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

/* Клип — обрезает аватарку по скруглённым углам */
.player-profile-avatar-clip {
    width: 100%;
    height: 100%;
    border-radius: 22px;
    border: 3px solid #a5640a;
    background: linear-gradient(to bottom left, #fff4dc, #f7d79a);
    overflow: hidden;
    box-sizing: border-box;
}

.player-profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* XP прогресс-бар на главном экране */
.player-profile-xp-bar-wrap {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.12);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 2px;
}
.player-profile-xp-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #c8a050, #e8c060);
    border-radius: 4px;
    width: 0%;
    transition: width 0.4s ease;
}
.player-profile-xp-label {
    font-size: 0.72rem;
    color: #6d655b;
    margin-top: 1px;
}

.player-profile-main {
    flex: 1;
    gap: 6px;
}

.player-profile-name {
    font-size: 1.55rem;
    font-weight: bold;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-profile-level {
    font-size: 1.1rem;
    color: #5b3911;
}

.player-profile-rank {
    font-size: 0.95rem;
    color: #6d655b;
}

.player-profile-meta {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
}

.player-profile-meta-row {
    width: 100%;
    border: 3px solid #a5640a;
    border-radius: 12px;
    padding: 8px 12px 6px;
    background: rgba(255,255,255,0.25);
    justify-content: space-between;
}

.player-profile-loadout {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.player-profile-loadout-preview {
    gap: 8px;
}

.player-profile-mini-ball-label {
    font-size: 0.9rem;
    color: #6d655b;
}

.player-profile-mini-ball {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    border: 3px solid #a5640a;
    background-color: rgba(255,255,255,0.25);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 38px 38px;
}

@media (max-width: 1200px) {
    #player-profile-card {
        min-width: 280px;
    }

    #loadout-modal {
        width: calc(100vw - 30px);
    }

    .loadout-modal-body {
        flex-direction: column;
        align-items: center;
    }
}

/* === Character screen loadout mode === */

#character-screen.loadout-open > :not(#loadout-overlay) {
    visibility: hidden !important;
    pointer-events: none !important;
}

#character-screen.loadout-open > :not(#loadout-overlay) {
    visibility: hidden !important;
    pointer-events: none !important;
}

#character-screen.loadout-open #loadout-overlay,
#character-screen.loadout-open #loadout-overlay * {
    visibility: visible !important;
    pointer-events: auto !important;
}

#character-screen.loadout-open #loadout-overlay {
    background: transparent !important;
}

/* === Match settings inside loadout modal === */

#loadout-match-settings {
    width: 100% !important;
    min-height: 150px !important;

    background: linear-gradient(to bottom left, #f9e5bd, #f8daa5) !important;
    border: 3px solid #a5640a !important;
    border-radius: 20px !important;
    box-shadow: none !important;
    outline: none !important;

    align-items: center !important;
    justify-content: center !important;
    gap: 14px !important;

    margin: 0 0 16px 0 !important;
    padding: 16px 20px 18px !important;
}

#loadout-match-settings h3 {
    font-size: 1.45rem !important;
    margin: 0 0 4px 0 !important;
}

.loadout-settings-row {
width: 92% !important;
align-self: center !important;
    align-items: center !important;
    gap: 24px !important;
}

#loadout-match-settings #player-name {
    width: 28ch !important;
    height: 44px !important;
    font-size: 1.25rem !important;
    padding: 4px 12px 2px !important;

    border: 3px solid #a5640a !important;
    border-radius: 14px !important;
}

.loadout-region-row {
    gap: 10px !important;
    align-items: center !important;
    justify-content: center !important;
}

.loadout-region-label {
    font-size: 1.1rem !important;
    color: #5b3911 !important;
}

#loadout-match-settings #region-btn {
    font-size: 1rem !important;
    padding: 5px 12px 3px !important;
}

/* === Center panel with Play button at the bottom === */

.character-screen-center-panel {
    min-height: 278px !important;
    justify-content: space-between !important;
    gap: 16px !important;
    padding-bottom: 12px !important;
}

.character-screen-play-btn {
    align-self: center !important;
    font-size: 1.6rem !important;
    padding: 7px 28px 5px !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
}

/* === Loadout modal — адаптивный размер без скролла === */
#loadout-modal {
    overflow: visible;
    max-height: none;
}

#loadout-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    overflow: hidden;
}

@media (max-height: 750px) {
    #loadout-modal { font-size: 0.88em; }
}
@media (max-height: 650px) {
    #loadout-modal { font-size: 0.76em; }
}
@media (max-height: 550px) {
    #loadout-modal { font-size: 0.64em; }
}

@media (max-width: 950px) {
    #loadout-modal { font-size: 0.88em; }
}
@media (max-width: 800px) {
    #loadout-modal { font-size: 0.76em; }
}
@media (max-width: 650px) {
    #loadout-modal { font-size: 0.64em; }
}

/* Private room and spectator controls */
.private-room-details {
    gap: 0.35em;
    width: 100%;
    font-size: 0.9em;
}

.private-settings-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3em;
    margin-top: 0.45em;
    word-spacing: normal;
}

.private-settings-list label {
    display: flex;
    align-items: center;
    gap: 0.45em;
    cursor: pointer;
    white-space: nowrap;
}

.private-settings-list input[type="checkbox"] {
    width: 1.15em;
    height: 1.15em;
    margin: 0;
}

#private-room-owner-note {
    max-width: 25ch;
    margin-top: 0.35em;
    font-size: 0.78em;
    opacity: 0.7;
    word-spacing: normal;
}

.private-room-leave {
    margin-top: 0.55em;
}

#private-match-panel {
    position: absolute;
    z-index: 50;
    top: 12px;
    left: 12px;
    display: flex;
    width: 356px;
    max-width: calc(100% - 24px);
    padding: 0;
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    border: 3px solid #6b3709;
    border-radius: 16px;
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 220, 139, 0.13), transparent 38%),
        linear-gradient(180deg, rgba(22, 69, 96, 0.97), rgba(8, 38, 57, 0.97));
    box-shadow:
        0 3px 0 #3f2109,
        0 8px 18px rgba(0, 20, 35, 0.34),
        inset 0 1px 0 rgba(255, 245, 203, 0.3),
        inset 0 0 0 1px rgba(255, 201, 96, 0.2);
    color: #f7e4b8;
    font-family: "South Africa";
    font-size: 12px;
    line-height: 1.15;
    word-spacing: normal;
    pointer-events: auto;
}

#private-match-panel.hidden {
    display: none;
}

.private-match-topbar {
    width: 100%;
    min-height: 47px;
    padding: 8px 10px 7px 12px;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 2px solid rgba(209, 154, 61, 0.58);
    background:
        linear-gradient(180deg, rgba(255, 226, 162, 0.2), rgba(173, 105, 24, 0.09)),
        rgba(8, 35, 52, 0.5);
    box-shadow: inset 0 -1px 0 rgba(255, 239, 198, 0.13);
}

.private-match-title-block {
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
}

.private-match-kicker {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #efbc57;
    font-size: 8px;
    letter-spacing: 0.14em;
    text-shadow: 0 1px 0 #3f2109;
}

.private-match-kicker::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border: 1px solid #6e3b0d;
    border-radius: 50%;
    background: #55ce69;
    box-shadow: 0 0 6px rgba(85, 206, 105, 0.65);
}

#private-match-room {
    max-width: 15ch;
    overflow: hidden;
    color: #fff1c9;
    font-size: 15px;
    font-weight: normal;
    letter-spacing: 0.035em;
    text-overflow: ellipsis;
    text-shadow: 0 2px 0 rgba(44, 22, 4, 0.8);
    white-space: nowrap;
}

.private-match-statuses {
    max-width: 174px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: center;
    gap: 4px;
}

.private-match-badge {
    min-height: 20px;
    padding: 3px 7px 2px;
    border: 1px solid rgba(255, 216, 137, 0.65);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(243, 187, 76, 0.31), rgba(155, 90, 19, 0.2));
    color: #ffe6aa;
    font-size: 9px;
    letter-spacing: 0.025em;
    text-shadow: 0 1px 0 rgba(43, 21, 4, 0.9);
    white-space: nowrap;
}

.private-match-badge-muted {
    border-color: rgba(174, 209, 222, 0.38);
    background: rgba(9, 32, 47, 0.55);
    color: #d7e8ee;
}

.private-match-body {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    justify-content: stretch;
}

.private-match-section {
    min-width: 0;
    padding: 9px 10px 10px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
}

.private-match-section + .private-match-section {
    border-left: 1px solid rgba(235, 189, 99, 0.3);
    box-shadow: inset 1px 0 0 rgba(10, 25, 35, 0.32);
}

.private-match-section-title {
    width: 100%;
    justify-content: flex-start;
    color: #e7b452;
    font-size: 9px;
    letter-spacing: 0.09em;
    text-shadow: 0 1px 0 rgba(50, 25, 5, 0.75);
}

#private-match-panel .private-settings-list {
    display: grid;
    width: 100%;
    margin: 0;
    padding: 0;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: stretch;
    border: 0;
}

#private-match-panel .private-toggle {
    position: relative;
    width: 100%;
    min-height: 27px;
    padding: 3px 6px 3px 4px;
    justify-content: flex-start;
    gap: 7px;
    border: 1px solid rgba(223, 184, 106, 0.18);
    border-radius: 8px;
    background: rgba(3, 26, 40, 0.34);
    color: #f4e6c6;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, transform 0.08s;
}

#private-match-panel .private-toggle:hover {
    border-color: rgba(244, 196, 96, 0.58);
    background: rgba(35, 80, 101, 0.55);
}

#private-match-panel .private-toggle:active {
    transform: scale(0.98);
}

#private-match-panel .private-toggle span {
    overflow: hidden;
    color: #fff0cb;
    font-size: 11px;
    letter-spacing: 0.015em;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(28, 14, 3, 0.85);
    white-space: nowrap;
}

#private-match-panel input[type="checkbox"] {
    position: relative;
    display: grid;
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin: 0;
    padding: 0;
    place-content: center;
    border: 2px solid #c8b487;
    border-radius: 6px;
    background: rgba(5, 25, 38, 0.82);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

#private-match-panel input[type="checkbox"]::after {
    content: "";
    width: 9px;
    height: 5px;
    margin-top: -2px;
    border-left: 3px solid #fff7df;
    border-bottom: 3px solid #fff7df;
    opacity: 0;
    transform: rotate(-45deg) scale(0.55);
    transition: opacity 0.1s, transform 0.1s;
}

#private-match-panel input[type="checkbox"]:checked {
    border-color: #f2c460;
    background: linear-gradient(180deg, #2196f3, #0868c5);
    box-shadow:
        0 0 0 1px rgba(255, 226, 150, 0.25),
        0 0 7px rgba(33, 150, 243, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.33);
}

#private-match-panel input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: rotate(-45deg) scale(1);
}

#private-match-panel input[type="checkbox"]:focus-visible {
    outline: 2px solid #fff0b7;
    outline-offset: 2px;
}

#private-match-panel input:disabled,
#private-room-settings input:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

#private-match-panel .private-toggle:has(input:disabled) {
    cursor: not-allowed;
    filter: grayscale(0.35);
}

#start.private-spectator-disabled {
    pointer-events: none;
    opacity: 0.55;
}

@media (max-width: 520px) {
    #private-match-panel {
        top: 8px;
        left: 8px;
        width: 330px;
        max-width: calc(100% - 16px);
        border-radius: 14px;
        font-size: 11px;
    }

    .private-match-topbar {
        min-height: 42px;
        padding: 6px 8px 6px 10px;
    }

    #private-match-room {
        font-size: 13px;
    }

    .private-match-badge {
        min-height: 18px;
        padding: 2px 6px 1px;
        font-size: 8px;
    }

    .private-match-section {
        padding: 7px 8px 8px;
    }

    #private-match-panel .private-toggle {
        min-height: 24px;
        gap: 6px;
    }

    #private-match-panel input[type="checkbox"] {
        width: 18px;
        height: 18px;
        min-width: 18px;
    }

    #private-match-panel .private-toggle span {
        font-size: 10px;
    }
}


/* ============================================================
   Ranked ladder card
   ============================================================ */
.ranked-mode-title {
    width: 100%;
    text-align: center;
    font-size: 0.82rem !important;
    letter-spacing: 0.08em;
    color: #4a3422;
}

.ranked-card {
    position: relative;
    width: min(260px, 86%);
    min-height: 150px;
    margin: 0 auto;
    padding: 8px 16px 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #4a2b12;
    text-align: center;
}

.ranked-current-rank-img {
    width: 135px;
    height: 135px;
    object-fit: contain;
    margin-bottom: -4px;
    filter: drop-shadow(0 3px 1px rgba(75, 42, 14, 0.18));
}

.ranked-current-rank-name {
    min-height: 22px;
    font-size: 1.15rem;
    line-height: 1;
    letter-spacing: 0.045em;
    color: #42250e;
}

.ranked-current-elo {
    min-height: 16px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: #76502b;
}

.ranked-progress-track {
    width: 100%;
    height: 10px;
    margin-top: 18px;
    overflow: hidden;
    box-sizing: border-box;
    border: 2px solid #6f3d16;
    border-radius: 7px;
    background: rgba(102, 57, 20, 0.13);
    box-shadow: inset 0 1px 2px rgba(55, 27, 7, 0.22);
}

.ranked-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(180deg, #f5c65c 0%, #ca7d22 100%);
    transition: width 320ms ease;
}

.ranked-progress-text {
    min-height: 14px;
    margin-top: 1px;
    font-size: 0.58rem;
    color: #5f3d20;
}

.ranked-next-rank {
    min-height: 14px;
    font-size: 0.52rem;
    color: #8a633b;
}

.ranked-card.ranked-calibration .ranked-current-rank-name {
    margin-top: 24px;
    color: #5d5145;
}

.ranked-card.ranked-calibration .ranked-current-elo,
.ranked-card.ranked-calibration .ranked-next-rank {
    color: #85776a;
}

.ranked-card.ranked-calibration .ranked-progress-fill {
    background: #9a9188;
}

.ranked-result-toast {
    position: absolute;
    left: 50%;
    bottom: -4px;
    z-index: 2;
    max-width: 250px;
    padding: 5px 9px 4px;
    border: 2px solid #6f3d16;
    border-radius: 9px;
    background: rgba(255, 234, 190, 0.97);
    color: #4b2c13;
    font-size: 0.55rem;
    line-height: 1.15;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

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

.ranked-result-toast.ranked-result-positive {
    color: #24602c;
}

.ranked-result-toast.ranked-result-negative {
    color: #8b2721;
}

@media (max-width: 520px) {
    .ranked-card {
        min-height: 142px;
        width: min(245px, 86%);
    }

    .ranked-current-rank-img {
        width: 54px;
        height: 54px;
    }
}

/* ============================================================
   Leaderboards: classic + ranked
   ============================================================ */
#highscores {
    width: 100%;
    justify-content: center;
    align-items: stretch;
}

#leaderboards-panel {
    position: relative;
    width: min(78vw, 930px);
    height: min(91vh, 760px);
    padding: 14px 18px 12px;
    box-sizing: border-box;
    overflow: hidden;
}

.leaderboards-title {
    font-size: 1.45rem;
    line-height: 1;
    margin: 2px 0 8px;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 7px;
}

.leaderboard-tab {
    border: 2px solid #764313;
    border-radius: 12px;
    background: rgba(255, 238, 190, 0.55);
    color: #3a332c;
    font-family: inherit;
    font-size: 0.92rem;
    padding: 5px 18px 3px;
    cursor: pointer;
}

.leaderboard-tab-active {
    background: #d6aa65;
    box-shadow: inset 0 -3px 0 rgba(91, 47, 10, 0.22);
    transform: translateY(-1px);
}

.leaderboard-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    width: 100%;
    overflow: hidden;
}

.leaderboard-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
    /* Резервируем место под ник и три строки статистики призёров.
       За счёт этого таблица с 4-го места начинается заметно ниже. */
    min-height: 306px;
    padding: 1px 10px 50px;
    box-sizing: border-box;
}

.leaderboard-podium-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    border-radius: 14px;
    padding: 2px 6px 7px;
}

.leaderboard-podium-place-1 { order: 2; padding-top: 0; }
.leaderboard-podium-place-2 { order: 1; transform: translateY(18px); }
.leaderboard-podium-place-3 { order: 3; transform: translateY(30px); }

.leaderboard-card-stars {
    position: absolute;
    top: 0;
    right: 14%;
    color: #f1d94c;
    font-size: 1.4rem;
    text-shadow: 0 1px 0 #b08315;
    transform: rotate(13deg);
}

.leaderboard-character-wrap {
    width: 100%;
    height: 116px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
}

.leaderboard-podium-place-1 .leaderboard-character-wrap { height: 142px; }
.leaderboard-podium-place-2 .leaderboard-character-wrap { height: 126px; }

.leaderboard-character {
    display: block;
    width: 125px;
    height: 125px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 4px 2px rgba(71, 52, 23, 0.2));
}

.leaderboard-podium-place-1 .leaderboard-character { width: 150px; height: 150px; }
.leaderboard-podium-place-2 .leaderboard-character { width: 136px; height: 136px; }

.leaderboard-podium-base {
    width: 86%;
    height: 42px;
    margin-top: -16px;
    border-radius: 50% 50% 10px 10px / 24% 24% 10px 10px;
    background: linear-gradient(90deg, #a9a69d, #eeeeea 43%, #b0ada5);
    border-bottom: 4px solid #89857e;
    box-shadow: 0 5px 5px rgba(74, 56, 28, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
    font-size: 1.35rem;
}

.leaderboard-podium-place-1 .leaderboard-podium-base {
    border-top: 4px solid #d3b120;
    background: linear-gradient(90deg, #9d9a92, #f4f3ef 43%, #aaa79f);
}
.leaderboard-podium-place-2 .leaderboard-podium-base { border-top: 4px solid #aaa9a6; }
.leaderboard-podium-place-3 .leaderboard-podium-base { border-top: 4px solid #a87545; }

.leaderboard-card-name {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    margin-top: 5px;
    font-size: 1rem;
    color: #111;
    font-weight: 700;
}

.leaderboard-card-rank {
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #111;
    font-weight: 700;
}

.leaderboard-card-rank img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.leaderboard-card-rank-classic { color: #7b5a28; }

.leaderboard-card-metrics {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    margin-top: 2px;
    font-size: 0.7rem;
    line-height: 1.15;
    color: #111;
    font-weight: 700;
    word-spacing: normal;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex: 1 1 auto;
    width: 100%;
    min-height: 115px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    margin-top: 8px;
    scrollbar-gutter: stable;
}

.leaderboard-list > .leaderboard-row {
    flex: 0 0 auto;
    width: 100%;
}

.leaderboard-row {
    display: grid;
    align-items: center;
    min-height: 39px;
    border-top: 1px solid rgba(112, 92, 63, 0.42);
    font-size: 0.86rem;
}

.leaderboard-row-default {
    grid-template-columns: 72px minmax(180px, 2fr) minmax(90px, 1fr) 78px 88px;
}

.leaderboard-row-ranked {
    grid-template-columns: 72px minmax(150px, 1.8fr) minmax(120px, 1.2fr) 68px 78px 92px;
}

.leaderboard-row-header {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 29px;
    border-top: 0;
    border-bottom: 1px solid rgba(112, 92, 63, 0.55);
    background: #f5dba7;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.leaderboard-row > div {
    min-width: 0;
    text-align: center;
    justify-content: center;
}
.leaderboard-place-cell {
    text-align: right !important;
    justify-content: flex-end !important;
    padding-right: 8px;
}

.leaderboard-player-cell,
.leaderboard-rank-cell {
    min-width: 0;
    overflow: hidden;
    text-align: left !important;
}

/* Фиксированная сетка внутри колонки Player: первая ячейка всегда
   принадлежит аватару, поэтому он не ездит из-за длины ника. */
.leaderboard-player-cell {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    justify-content: stretch !important;
    column-gap: 6px;
    padding: 0 8px 0 4px;
}

.leaderboard-player-avatar {
    width: 36px;
    height: 36px;
    justify-self: center;
    border-radius: 50%;
    border: 1px solid #b5a486;
    background-color: rgba(255,255,255,0.35);
    background-repeat: no-repeat;
    /* Кадрирование повторяет старые highscores-image: крупный портрет
       лица/верхней части персонажа, а не вся модель целиком. */
    background-size: 63px auto;
    background-position: -22px -9px;
}

.leaderboard-rank-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    gap: 8px;
}

.leaderboard-player-cell span,
.leaderboard-rank-cell span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
    justify-self: start;
}

.leaderboard-rank-cell img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    flex: 0 0 auto;
}

.leaderboard-number-cell { font-variant-numeric: tabular-nums; }

.leaderboard-self {
    color: #078414;
    font-weight: bold;
    background: rgba(74, 174, 60, 0.09);
}

.leaderboard-footer {
    flex: 0 0 auto;
    margin: 5px 0 0;
    font-size: 0.82rem;
    line-height: 1.15;
}

.leaderboard-footer #play-button-highscores { margin-top: 5px; }
.leaderboard-legacy { display: none !important; }
.leaderboard-empty { grid-column: 1 / -1; align-self: center; opacity: 0.7; }

@media (max-width: 900px), (max-height: 690px) {
    #leaderboards-panel { width: min(92vw, 820px); height: min(94vh, 660px); }
    .leaderboard-podium { min-height: 250px; padding-bottom: 44px; }
    .leaderboard-character-wrap { height: 92px; }
    .leaderboard-podium-place-1 .leaderboard-character-wrap { height: 112px; }
    .leaderboard-podium-place-2 .leaderboard-character-wrap { height: 102px; }
    .leaderboard-character { width: 102px; height: 102px; }
    .leaderboard-podium-place-1 .leaderboard-character { width: 122px; height: 122px; }
    .leaderboard-podium-place-2 .leaderboard-character { width: 112px; height: 112px; }
    .leaderboard-row { font-size: 0.75rem; }
    .leaderboard-row-default { grid-template-columns: 58px minmax(145px, 1.8fr) 70px 58px 68px; }
    .leaderboard-list { margin-top: 6px; }
    .leaderboard-row-ranked { grid-template-columns: 58px minmax(125px, 1.7fr) minmax(92px, 1fr) 55px 65px 75px; }
}


/* ============================================================
   Ranked system help modal — compact v8 layout
   ============================================================ */
.ranked-info-button {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    padding: 0;
    overflow: visible;
    border: 2px solid #704015;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffe8a9 0%, #d99837 100%);
    box-shadow: 0 2px 0 #7b4318, 0 3px 7px rgba(73, 37, 8, 0.28);
    color: #4b290d;
    cursor: pointer;
    transition: transform 130ms ease, filter 130ms ease;
}

.ranked-info-glyph {
    display: block;
    color: #4b290d;
    font-family: Arial Black, Arial, sans-serif !important;
    font-size: 19px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-align: center;
    transform: translateY(-1px);
    pointer-events: none;
}

.ranked-info-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.ranked-info-button:active {
    transform: translateY(1px);
}

.ranked-guide-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 14px;
    background: rgba(30, 15, 4, 0.66);
    backdrop-filter: blur(2px);
}

.ranked-guide-overlay.ranked-guide-hidden {
    display: none;
}

.ranked-guide-panel {
    width: min(890px, calc(100vw - 28px));
    max-height: min(92vh, 620px);
    overflow: hidden;
    box-sizing: border-box;
    padding: 13px 16px 14px;
    border: 5px solid #875019;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffe9b9 0%, #f2ca86 100%);
    box-shadow: 0 10px 0 rgba(74, 37, 9, 0.38), 0 22px 48px rgba(0, 0, 0, 0.46), inset 0 0 0 3px rgba(255, 247, 214, 0.72);
    color: #4a2b12;
    text-align: center;
}

.ranked-guide-panel,
.ranked-guide-panel * {
    box-sizing: border-box;
}

.ranked-guide-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 52px;
}

.ranked-guide-heading {
    min-width: 0;
    text-align: center;
}

.ranked-guide-header h2 {
    margin: 0;
    color: #42250e;
    font-size: 1.42rem;
    line-height: 1;
    letter-spacing: 0.055em;
    white-space: nowrap;
}

.ranked-guide-kicker {
    margin-bottom: 3px;
    color: #9b6425;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 0.52rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.15em;
}

.ranked-guide-close {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 33px;
    padding: 0;
    border: 2px solid #6e3716;
    border-radius: 9px;
    background: linear-gradient(180deg, #d95934 0%, #a6291e 100%);
    box-shadow: 0 3px 0 #6f2519;
    color: #fff1ca;
    font-family: Arial Black, Arial, sans-serif;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.ranked-guide-status {
    margin: 1px auto 9px;
    text-align: center;
}

.ranked-guide-current {
    color: #3f250e;
    font-size: 0.82rem;
    line-height: 1.15;
    letter-spacing: 0.04em;
    white-space: normal;
}

.ranked-guide-current-note {
    min-height: 14px;
    margin-top: 3px;
    color: #805329;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: normal;
}

.ranked-guide-layout {
    display: grid;
    grid-template-columns: minmax(330px, 0.95fr) minmax(390px, 1.05fr);
    align-items: start;
    gap: 13px;
    min-width: 0;
}

.ranked-guide-visual-column,
.ranked-guide-details-column {
    min-width: 0;
}

.ranked-guide-image {
    display: block;
    width: min(430px, 100%);
    max-height: 242px;
    aspect-ratio: 16 / 9;
    margin: 0 auto 8px;
    object-fit: contain;
    border: 2px solid rgba(126, 73, 22, 0.46);
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(92, 48, 11, 0.17);
}

.ranked-guide-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 7px;
}

.ranked-guide-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 49px;
    padding: 5px 3px;
    border: 2px solid rgba(112, 64, 21, 0.52);
    border-radius: 9px;
    background: rgba(255, 242, 202, 0.68);
}

.ranked-guide-metric strong {
    font-size: 0.98rem;
    line-height: 1;
}

.ranked-guide-metric span {
    margin-top: 3px;
    color: #71461e;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 0.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.035em;
    white-space: normal;
}

.ranked-guide-division-card {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    column-gap: 10px;
    row-gap: 2px;
    min-height: 46px;
    padding: 6px 9px;
    border-radius: 9px;
    background: rgba(129, 74, 22, 0.1);
    font-family: "Open Sans", Arial, sans-serif;
}

.ranked-guide-division-card > span {
    color: #71461e;
    font-size: 0.53rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.ranked-guide-division-card > strong {
    color: #4a2b12;
    font-family: "South Africa", Arial, sans-serif;
    font-size: 0.74rem;
    white-space: nowrap;
}

.ranked-guide-division-card > small {
    grid-column: 1 / -1;
    color: #704821;
    font-size: 0.57rem;
    font-weight: 700;
    line-height: 1.2;
}

.ranked-guide-section-title {
    margin: 0 0 6px;
    color: #4b2b11;
    font-size: 0.72rem;
    line-height: 1.1;
    letter-spacing: 0.065em;
    text-align: left;
}

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

.ranked-guide-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 39px;
    padding: 6px 8px;
    border: 2px solid rgba(116, 67, 22, 0.46);
    border-radius: 9px;
    background: rgba(255, 238, 195, 0.5);
    text-align: left;
}

.ranked-guide-range:last-child {
    grid-column: 1 / -1;
}

.ranked-guide-range b {
    min-width: 0;
    overflow: hidden;
    font-size: 0.59rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranked-guide-range span {
    color: #79502b;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 0.5rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

.ranked-guide-range.ranked-guide-range-current {
    border-color: #ca7c20;
    background: #fff0b9;
    box-shadow: 0 0 0 2px rgba(219, 143, 42, 0.23);
}

.ranked-guide-rules-title {
    margin-top: 9px;
}

.ranked-guide-rules {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: "Open Sans", Arial, sans-serif;
    text-align: left;
}

.ranked-guide-rule {
    display: block !important;
    min-width: 0;
    min-height: 75px;
    padding: 8px 9px;
    border: 2px solid rgba(116, 67, 22, 0.38);
    border-radius: 9px;
    background: rgba(255, 243, 209, 0.58);
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word;
}

.ranked-guide-rule b {
    display: block !important;
    margin-bottom: 4px;
    color: #593314;
    font-family: "South Africa", Arial, sans-serif;
    font-size: 0.52rem;
    line-height: 1.15;
    letter-spacing: 0.035em;
    white-space: normal !important;
}

.ranked-guide-rule span {
    display: block !important;
    color: #4f3a27;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 0.59rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    white-space: normal !important;
    word-spacing: normal !important;
}

.ranked-guide-ok {
    min-width: 150px;
    margin-top: 10px;
    padding: 7px 18px 6px;
    border: 2px solid #704015;
    border-radius: 10px;
    background: linear-gradient(180deg, #f4c85f 0%, #c67a22 100%);
    box-shadow: 0 3px 0 #7a4216;
    color: #44260d;
    font-family: "South Africa", Arial, sans-serif;
    cursor: pointer;
}

@media (max-height: 650px) and (min-width: 761px) {
    .ranked-guide-panel {
        max-height: 94vh;
        padding-top: 10px;
        padding-bottom: 11px;
    }

    .ranked-guide-header {
        min-height: 39px;
    }

    .ranked-guide-image {
        width: min(360px, 100%);
        max-height: 203px;
    }

    .ranked-guide-rule {
        min-height: 66px;
        padding: 6px 8px;
    }

    .ranked-guide-rule span {
        font-size: 0.55rem;
        line-height: 1.28;
    }

    .ranked-guide-ok {
        margin-top: 7px;
        padding-top: 5px;
        padding-bottom: 4px;
    }
}

@media (max-width: 760px) {
    .ranked-guide-overlay {
        align-items: flex-start;
        padding: 8px;
        overflow-y: auto;
    }

    .ranked-guide-panel {
        width: 100%;
        max-height: none;
        margin: auto 0;
        padding: 11px 10px 14px;
        overflow: visible;
        border-width: 4px;
    }

    .ranked-guide-header {
        min-height: 44px;
        padding: 0 44px;
    }

    .ranked-guide-header h2 {
        font-size: 1.08rem;
    }

    .ranked-guide-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ranked-guide-image {
        width: min(470px, 100%);
        max-height: none;
    }

    .ranked-guide-details-column {
        display: block;
    }
}

@media (max-width: 460px) {
    .ranked-info-button {
        top: 1px;
        right: 1px;
        width: 29px;
        height: 29px;
    }

    .ranked-guide-current {
        font-size: 0.7rem;
    }

    .ranked-guide-current-note {
        font-size: 0.58rem;
    }

    .ranked-guide-ranges,
    .ranked-guide-rules {
        grid-template-columns: 1fr;
    }

    .ranked-guide-range:last-child {
        grid-column: auto;
    }

    .ranked-guide-rule {
        min-height: 0;
    }
}



/* ============================================================
   Match presentation + post-match result refresh
   ============================================================ */

.opponent-found-panel {
    position: relative !important;
    width: min(460px, calc(100vw - 28px)) !important;
    min-width: 0 !important;
    padding: 17px 18px 15px !important;
    box-sizing: border-box !important;
    align-items: stretch !important;
    overflow: visible !important;
}

#opponent-found-title {
    margin: 0 !important;
    font-size: 2.35rem !important;
    font-weight: bold !important;
    white-space: nowrap !important;
    align-self: center !important;
}

#server-name {
    margin: 1px 0 8px !important;
    font-size: 0.92rem !important;
    align-self: center !important;
}

.opponent-found-player {
    display: flex !important;
    width: 100% !important;
    min-height: 88px !important;
    align-items: center !important;
    gap: 9px !important;
    box-sizing: border-box !important;
}

.opponent-found-player-left {
    justify-content: flex-start !important;
}

.opponent-found-player-right {
    justify-content: flex-end !important;
}

.opponent-preview-wrap {
    position: relative !important;
    flex: 0 0 80px !important;
    width: 80px !important;
    height: 80px !important;
    overflow: visible !important;
}

.opponent-preview-container {
    position: relative !important;
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
    margin: 0 !important;
    overflow: hidden !important;
    flex: 0 0 80px !important;
    box-sizing: border-box !important;
}

#opponent-preview-1,
#opponent-preview-2 {
    position: absolute !important;
    z-index: 1 !important;
    left: 46% !important;
    top: 54% !important;
    width: 166% !important;
    height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
    object-fit: contain !important;
    display: block !important;
    filter: drop-shadow(0 0 0 #000) !important;
}

.opponent-admin-badge {
    display: none;
    position: absolute !important;
    z-index: 8 !important;
    left: 50% !important;
    top: -31px !important;
    width: 26px !important;
    height: 26px !important;
    max-width: none !important;
    transform: translateX(-50%) !important;
    object-fit: contain !important;
    pointer-events: none !important;
    filter: drop-shadow(0 2px 1px rgba(52, 29, 6, 0.35)) !important;
}

.opponent-found-player-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
}

.opponent-found-player-info-left {
    align-items: flex-start !important;
    text-align: left !important;
}

.opponent-found-player-info-right {
    align-items: flex-end !important;
    text-align: right !important;
}

.opponent-found-name {
    max-width: 185px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 1.42rem !important;
    line-height: 1.05 !important;
}

.opponent-found-level {
    margin-top: 2px !important;
    font-size: 0.92rem !important;
}

.opponent-found-rank-side {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 86px !important;
    width: 86px !important;
    min-height: 76px !important;
    margin-left: auto !important;
    line-height: 1 !important;
}

.opponent-found-player-right .opponent-found-rank-side {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.opponent-found-rank-icon {
    display: none;
    width: 72px !important;
    height: 72px !important;
    max-width: none !important;
    object-fit: contain !important;
    margin: 0 0 -3px !important;
    filter: drop-shadow(0 3px 1px rgba(75, 42, 14, 0.22)) !important;
}


.opponent-found-rank-side[data-rank-tier="calibration"] .opponent-found-rank-icon {
    width: 68px !important;
    height: 68px !important;
    border-radius: 50% !important;
}

.opponent-found-rank-calibration {
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    width: 49px !important;
    height: 49px !important;
    margin-bottom: 3px !important;
    border: 3px solid #8d581c !important;
    border-radius: 50% !important;
    background: linear-gradient(180deg, #f7d88d 0%, #cc8c35 100%) !important;
    box-shadow: 0 3px 0 #744013, inset 0 1px 0 rgba(255,255,255,0.55) !important;
    color: #5a2704 !important;
    font-family: 'South Africa', Arial, sans-serif !important;
    font-size: 1.55rem !important;
}

.opponent-found-rank-name {
    max-width: 94px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #5a2704 !important;
    font-size: 0.62rem !important;
    line-height: 1.05 !important;
    letter-spacing: 0.02em !important;
    text-align: center !important;
}

.opponent-found-vs {
    margin: -8px 0 !important;
    align-self: center !important;
    font-size: 2.45rem !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

#hud-container .name-left,
#hud-container .name-right {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
}

#hud-container .vr-hud-admin-name::before {
    content: '' !important;
    display: inline-block !important;
    width: 23px !important;
    height: 23px !important;
    flex: 0 0 23px !important;
    background: url('assets/admin-badge.png') center / contain no-repeat !important;
    filter: drop-shadow(0 2px 1px rgba(52, 29, 6, 0.35)) !important;
}

.end-match-summary-panel {
    position: relative !important;
    width: min(620px, calc(100vw - 26px)) !important;
    padding: 15px 14px 13px !important;
    box-sizing: border-box !important;
}

.end-match-elo-change {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 29px !important;
    margin: 7px 0 2px !important;
    padding: 4px 10px 2px !important;
    box-sizing: border-box !important;
    border: 3px solid #5a2704 !important;
    border-radius: 10px !important;
    background: rgba(214, 181, 131, 0.72) !important;
    color: #5a2704 !important;
    font-size: 1rem !important;
    letter-spacing: 0.04em !important;
}

.end-match-elo-change.elo-positive {
    color: #267112 !important;
    border-color: #267112 !important;
    background: rgba(199, 236, 161, 0.72) !important;
}

.end-match-elo-change.elo-negative {
    color: #a62f20 !important;
    border-color: #a62f20 !important;
    background: rgba(247, 190, 171, 0.72) !important;
}

.end-match-share-section {
    width: 100% !important;
    margin-top: 8px !important;
    align-items: center !important;
}

.end-match-x-share {
    min-width: 210px !important;
    margin: 0 !important;
    padding: 7px 16px 4px !important;
    color: #fff !important;
    background: #282828 !important;
    border-color: #111 !important;
    font-size: 1.02rem !important;
    gap: 5px !important;
}

.end-match-x-share:hover {
    filter: brightness(1.15) !important;
}

.end-match-actions-row {
    min-height: 156px !important;
    height: auto !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

.ranked-match-result-overlay {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    z-index: 850 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 18px !important;
    box-sizing: border-box !important;
    background: transparent !important;
    opacity: 0;
    transition: opacity 180ms ease !important;
    pointer-events: none !important;
}

.ranked-match-result-overlay.ranked-match-result-visible {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.ranked-match-result {
    width: min(310px, calc(100vw - 36px)) !important;
    padding: 18px 20px 16px !important;
    box-sizing: border-box !important;
    gap: 2px !important;
    cursor: pointer !important;
    transform: scale(0.78) translateY(14px);
    opacity: 0;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5) !important;
}

.ranked-match-result-overlay.ranked-match-result-visible .ranked-match-result {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}

.ranked-match-result-kicker {
    color: #8a5b21 !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.12em !important;
}

.ranked-match-result-image {
    width: 118px !important;
    height: 118px !important;
    margin: 2px 0 -2px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 5px 2px rgba(75, 42, 14, 0.22)) !important;
}

.ranked-match-result-name {
    color: #4d2a10 !important;
    font-size: 1.55rem !important;
    line-height: 1.05 !important;
}

.ranked-match-result-delta {
    margin-top: 4px !important;
    color: #267112 !important;
    font-size: 2rem !important;
    line-height: 1 !important;
}

.ranked-match-result-delta.elo-negative {
    color: #b43122 !important;
}

.ranked-match-result-delta.elo-neutral {
    color: #80552a !important;
}

.ranked-match-result-note {
    margin-top: 6px !important;
    color: #80552a !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    text-align: center !important;
    white-space: normal !important;
}

@media (max-height: 600px) {
    .end-match-summary-panel {
        transform: scale(0.9) !important;
        transform-origin: center top !important;
        margin-bottom: -34px !important;
    }

    .end-match-actions-row {
        transform: scale(0.9) !important;
        transform-origin: center top !important;
    }
}

@media (max-width: 520px) {
    .opponent-found-panel {
        width: calc(100vw - 18px) !important;
        padding-left: 13px !important;
        padding-right: 13px !important;
    }

    #opponent-found-title {
        font-size: 1.95rem !important;
    }

    .opponent-found-name {
        max-width: 125px !important;
        font-size: 1.18rem !important;
    }

    .opponent-found-player {
        gap: 6px !important;
    }

    .opponent-found-rank-side {
        flex-basis: 66px !important;
        width: 66px !important;
    }

    .opponent-found-rank-icon {
        width: 53px !important;
        height: 53px !important;
    }

    .opponent-found-rank-name {
        max-width: 72px !important;
        font-size: 0.55rem !important;
    }
}
