@font-face {
    font-family: 'TF2Build';
    src: url('https://cdn.unspacecommand.net/u/TF2Build.ttf') format('truetype');
}

:root {
    --center: 427px;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000 url('ui/ctf_2fort_background_hd.png') no-repeat center center fixed;
    background-size: cover;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#engine-container {
    width: 854px;
    height: 480px;
    position: relative;
    transform: scale(var(--scale-factor, 1));
    transform-origin: center center;
}

.tf-element {
    position: absolute;
    box-sizing: border-box;
    font-family: 'TF2Build', impact, sans-serif;
    color: #ebe2ca;
}

.MainMenuBGBorder {
    background: linear-gradient(to bottom, #39342e, #1d1812);
    border-radius: 2px;
}

.MainMenuButton {
    background: linear-gradient(to bottom, #d0cab4, #a08f75);
    border: none;
    border-radius: 2px;
    color: #2f2822;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    padding: 0px 25px;
    text-align: left;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.MainMenuButton:hover {
    background: linear-gradient(to bottom, #9f4f40, #542b21);
    color: #ebe2ca;
}

.MainMenuButton:active {
    background: linear-gradient(to bottom, #907f65, #806f55);
    color: #2f2822;
}

.MainMenuMiniButton {
    background: linear-gradient(to bottom, #d0cab4, #a08f75);
    border: none;
    border-radius: 2px;
    color: #2f2822;
    font-size: 18px;
    cursor: pointer;
    outline: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.MainMenuMiniButton:hover {
    background: linear-gradient(to bottom, #9f4f40, #542b21);
    color: #ebe2ca;
}

.MainMenuMiniButton:active {
    background: linear-gradient(to bottom, #907f65, #806f55);
}

.btn-icon {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    height: 11px;
    width: auto;
    object-fit: contain;
    pointer-events: none;
    filter: brightness(0) sepia(1) hue-rotate(340deg) saturate(1.5) brightness(0.5);
}

#TFLogoImage {
    left: calc(var(--center) - 290px);
    top: 24px;
    width: 256px;
    height: 64px;
    background: url('web/tfn.png') no-repeat center;
    background-size: contain;
}

#TFCharacterImage {
    left: calc(var(--center) - 80px);
    top: 0px;
    width: 600px;
    height: 600px;
    background: url('ui/character/tfbot-menu-pose.png') no-repeat bottom center;
    background-size: contain;
    pointer-events: none;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
    z-index: 5;
}

#MainMenuBGPanel {
    left: calc(var(--center) - 290px);
    top: 92px;
    width: 260px;
    height: 99px;
    z-index: 0;
}

#PlayLabel {
    left: calc(var(--center) - 278px);
    top: 92px;
    width: 140px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
    text-transform: uppercase;
    z-index: 10;
}

.btn-1 {
    left: calc(var(--center) - 285px);
    top: 116px;
    width: 250px;
    height: 19px;
    z-index: 10;
}

.btn-2 {
    left: calc(var(--center) - 285px);
    top: 142px;
    width: 250px;
    height: 19px;
    z-index: 10;
}

.btn-3 {
    left: calc(var(--center) - 285px);
    top: 168px;
    width: 250px;
    height: 19px;
    z-index: 10;
}

#CustomizeBGPanel {
    left: calc(var(--center) - 290px);
    top: 205px;
    width: 260px;
    height: 47px;
    z-index: 0;
}

#CustomizeLabel {
    left: calc(var(--center) - 278px);
    top: 205px;
    width: 140px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
    text-transform: uppercase;
    z-index: 10;
}

.btn-4a {
    left: calc(var(--center) - 285px);
    top: 229px;
    width: 122px;
    height: 19px;
    z-index: 10;
}

.btn-4b {
    left: calc(var(--center) - 157px);
    top: 229px;
    width: 122px;
    height: 19px;
    z-index: 10;
}

#MOTD_Button {
    left: calc(var(--center) + 370px);
    top: 28px;
    z-index: 10;
    cursor: pointer;
    transform: scale(0.25);
    transform-origin: top left;
}

#BottomBar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: calc(44px * var(--scale-factor, 1));
    background-color: #393430;
    border-top: calc(1px * var(--scale-factor, 1)) solid #4a443e;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

#BottomBarContent {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    transform: scale(var(--scale-factor, 1));
    transform-origin: bottom center;
}

.BottomBarButton {
    background: #776b5f;
    border: none;
    border-radius: 2px;
    color: #ebe2ca;
    font-family: 'TF2Build', impact, sans-serif;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
}

.BottomBarButton:hover {
    background: #9f4f40;
}

.bottom-icon {
    height: 11px;
    width: auto;
    object-fit: contain;
    pointer-events: none;
    filter: brightness(0) invert(1) sepia(0.3) hue-rotate(5deg) saturate(1) brightness(0.9);
}

.BottomIconGroup {
    display: flex;
    background: #776b5f;
    border-radius: 2px;
    margin: 0 15px;
    overflow: hidden;
}

.BottomIconGroup .BottomBarButton {
    width: 24px;
    border-radius: 0;
}

.BottomIconGroup .BottomBarButton:not(:first-child) {
    border-left: 1px solid #393430;
}

.ribbon {
    position: absolute;
    left: calc(var(--center) - 52px);
    top: 60px;
    width: 50px;
    height: auto;
    z-index: 15;
    transform: rotate(-23deg);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.vgui-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    background-color: #3b3631;
    border: 1px solid #5a5249;
    border-radius: 6px;
    font-family: 'Lucida Console', Monaco, monospace;
    color: #ebe2ca;
    z-index: 100;
    font-size: 12px;
    padding: 15px;
}

.vgui-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.vgui-titlebar span {
    font-size: 18px;
    text-transform: uppercase;
    font-weight: normal;
    letter-spacing: 1px;
}

.vgui-close-btn {
    background: transparent;
    color: #b5a994;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.vgui-close-btn:hover {
    color: #ebe2ca;
}

.vgui-tabs {
    display: flex;
    gap: 2px;
    padding-left: 10px;
}

.vgui-tab {
    padding: 6px 15px;
    background-color: #7b6f5f;
    color: #d8ceb8;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100px;
    box-sizing: border-box;
}

.vgui-tab.active {
    background-color: #928371;
    color: #ffffff;
}

.vgui-content {
    padding: 25px;
    border: 1px solid #5a5249;
    margin-top: -1px; /* Overlap active tab slightly if needed, but keeping it flush is fine */
}

.vgui-setting-row {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.vgui-setting-row label {
    width: 140px;
    color: #d8ceb8;
}

.vgui-select {
    flex-grow: 1;
    background-color: #2b2724;
    color: #ebe2ca;
    border: 1px solid #1a1715;
    padding: 4px;
    font-family: 'Lucida Console', Monaco, monospace;
    font-size: 12px;
}

.vgui-slider {
    flex-grow: 0;
    width: 40%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 24px;
}

.vgui-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 24px;
    box-sizing: border-box;
    padding: 0 4px;
    background-origin: content-box;
    background: 
        linear-gradient(#1a1715, #1a1715) no-repeat center 8px / 100% 2px,
        linear-gradient(#a29887, #a29887) no-repeat 0% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 10% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 20% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 30% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 40% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 50% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 60% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 70% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 80% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 90% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 100% 14px / 2px 5px;
    border: none;
}

.vgui-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 10px;
    background: #a59c86;
    border: none;
    margin-top: 1px;
    cursor: pointer;
}

.vgui-slider::-moz-range-track {
    width: 100%;
    height: 24px;
    box-sizing: border-box;
    padding: 0 4px;
    background-origin: content-box;
    background: 
        linear-gradient(#1a1715, #1a1715) no-repeat center 8px / 100% 2px,
        linear-gradient(#a29887, #a29887) no-repeat 0% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 10% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 20% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 30% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 40% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 50% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 60% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 70% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 80% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 90% 14px / 2px 5px,
        linear-gradient(#a29887, #a29887) no-repeat 100% 14px / 2px 5px;
    border: none;
}

.vgui-slider::-moz-range-thumb {
    appearance: none;
    height: 16px;
    width: 10px;
    background: #a59c86;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.vgui-bottom {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
    gap: 10px;
}

.vgui-btn {
    background-color: #8c7e6b;
    color: #2b2724;
    border: 1px solid #6b5f50;
    padding: 4px 10px;
    font-family: 'Lucida Console', Monaco, monospace;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    width: 80px;
}

.vgui-btn:active {
    background-color: #7b6f5f;
}