:root {
    --roblox-red: #C0392B;
    --roblox-dark-grey: #2C3E50;
    --roblox-mid-grey: #34495E;
    --roblox-light-grey: #7F8C8D;
    --roblox-background: #1A2632;
    --roblox-text: #ECF0F1;
    --roblox-red-dark: #A52422;
    --roblox-red-bright: #C0392B;
    --roblox-grey-dark: #2C3E50;
    --roblox-grey-medium: #34495E;
    --roblox-grey-light: #7F8C8D;
    --roblox-text-primary: #ECF0F1;
    --roblox-text-secondary: #BDC3C7;
}

body {
    background-color: var(--roblox-background);
    color: var(--roblox-text);
    font-family: 'Roboto', 'Arial', sans-serif;
    background-color: #1A2632;
    color: #ECF0F1;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
    overflow: hidden;
}

body button,
body .button,
body #hotbar .tool-slot,
body #roblox-logo,
body #chat-icon,
body #change-skin-button {
    cursor: pointer;
}

#container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        45deg, 
        rgba(26, 38, 50, 0.9), 
        rgba(52, 73, 94, 0.9)
    );
    box-shadow: inset 0 0 200px rgba(0,0,0,0.5);
    padding: 0;
    overflow: hidden;
}

#scene-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#roblox-logo {
    position: absolute;
    top: 20px;
    left: 10px;
    width: 40px;
    height: 40px;
    z-index: 10;
    transition: transform 0.3s ease;
    background-image: url('/images.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#roblox-logo:hover {
    transform: scale(1.1);
}

#change-skin-button {
    width: auto;
    height: 40px;
    background-color: #E31B23;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#change-skin-button:hover {
    background-color: #FF424A;
}

#loading-bar-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 15px;
    display: none;
    z-index: 20;
}

#loading-bar {
    height: 20px;
    background-color: #4CAF50;
    width: 0%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

#loading-text {
    color: white;
    text-align: center;
    margin-top: 10px;
    font-size: 16px;
}

#file-menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: url('/CorrodedMetal.png') no-repeat center center;
    background-size: cover;
    border: 3px solid #C0392B;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.4), 
        inset 0 0 50px rgba(0,0,0,0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.menu-header .menu-tab {
    background-color: #E31B23;
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 4px;
}

.menu-header .menu-tab.active {
    background-color: #FF424A;
}

.menu-header .menu-button {
    background-color: #444;
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 4px;
    margin-left: 5px;
}

.menu-content {
    background-color: #333;
    padding: 10px;
    border-radius: 4px;
}

.menu-content h3 {
    color: white;
    margin-top: 0;
    text-align: center;
    border-bottom: 1px solid #555;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.menu-content .file-item {
    background-color: #444;
    color: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.menu-content .file-item:hover {
    background-color: #555;
    transform: translateX(5px);
}

#chat-icon {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 52px;
    background-image: url('/CloneButton_dn.png');
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    box-shadow: 0 2px 6px rgba(0,0,0,0.28);
}

#chat-icon svg {
    width: 70%;
    height: 70%;
    display: block;
}

#chatbox {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 400px;
    max-height: 600px;
    background-color: rgba(40, 40, 40, 0.9);
    border: 2px solid #E31B23;
    border-radius: 8px;
    display: none;
    z-index: 150;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background-image: url('/btn_grey_slice4.png');
    background-repeat: repeat;
}

#chatbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: linear-gradient(90deg, #E31B23, #FF424A);
    color: white;
    font-size: 16px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

#chatbox-header button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
}

#chatbox-messages {
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
    color: white;
    font-size: 14px;
    max-height: 350px;
}

#chatbox-input {
    display: flex;
    border-top: 1px solid #555;
}

#chatbox-input input {
    flex-grow: 1;
    padding: 5px;
    border: none;
    outline: none;
    font-size: 14px;
    background-color: #555;
    color: white;
}

#chatbox-input button {
    background-color: #E31B23;
    border: none;
    padding: 5px 10px;
    color: white;
    font-size: 14px;
}

.chat-message {
    margin-bottom: 5px;
    word-wrap: break-word;
    background: url('/btn_white_slice9.png') repeat;
    border-left: 4px solid var(--roblox-red-bright);
    box-shadow: 
        0 2px 5px rgba(0,0,0,0.2),
        inset 0 0 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    padding: 8px 12px;
}

.chat-message:hover {
    transform: translateX(5px);
    background: url('/btn_red_slice8.png') repeat;
}

#player-list {
    display: none;
}

#notification-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 400px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.notification {
    background: url('/btn_grey_slice4.png') repeat;
    border-left: 5px solid var(--roblox-red-bright);
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.3),
        inset 0 0 20px rgba(0,0,0,0.2);
    animation: notification-slide 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    color: white;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    width: 100%;
    text-align: center;
}

@keyframes notification-slide {
    0% { 
        opacity: 0; 
        transform: translateY(50px) rotate(10deg); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) rotate(0deg); 
    }
}

#hotbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-image: url('/Gear.png');
    background-size: cover;
    background-repeat: repeat;
    border: 2px solid rgba(192, 57, 43, 0.5);
    box-shadow: 
        0 5px 15px rgba(0,0,0,0.4), 
        inset 0 0 20px rgba(0,0,0,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.hotbar-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tool-slot {
    width: 50px;
    height: 50px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 3px 6px rgba(0,0,0,0.2), 
        inset 0 0 10px rgba(255,255,255,0.1);
}

.tool-slot:hover {
    transform: scale(1.15) rotate(3deg);
    box-shadow: 
        0 8px 15px rgba(192, 57, 43, 0.5), 
        inset 0 0 20px rgba(192, 57, 43, 0.3);
}

.tool-slot.active {
    border: 2px solid #E31B23;
}

#paint-tool-ui,
#build-tool-ui {
    position: absolute;
    bottom: 80px;
    left: 20px;
    background-color: rgba(40, 40, 40, 0.9);
    border: 2px solid #E31B23;
    border-radius: 8px;
    padding: 10px;
    z-index: 100;
    display: none;
    flex-direction: column;
}

#paint-tool-ui button,
#build-tool-ui button {
    margin: 5px 0;
    border: none;
}

#paint-tool-ui .paint-color-btn {
    width: 30px;
    height: 30px;
}

#build-tool-ui .build-shape-btn {
    width: auto;
    padding: 5px 10px;
    color: white;
    background-color: #444;
    font-size: 14px;
}

#paint-tool-ui button:hover,
#build-tool-ui button:hover {
    background-color: #555;
}

#paint-tool-ui .paint-color-btn.selected,
#build-tool-ui .build-shape-btn.selected {
    outline: 2px solid #ffff00;
}

#paintball-hit-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.scaling-active {
    cursor: ew-resize;
}

.handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #0088ff;
    border-radius: 50%;
    cursor: grab;
}

.health-bar-container {
    position: absolute;
    width: 100px;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1000;
    right: 50px;
    top: 20px;
}

.health-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right, 
        #2ECC71, 
        #27AE60
    );
    box-shadow: 
        inset 0 0 10px rgba(0,0,0,0.3);
    transition: width 0.3s ease;
}

.corner-health {
    display: none;
}

#chat-prompt {
    position: absolute;
    top: 400px;
    left: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex; 
}

.modal-content {
    background-image: url('/Gear.png');
    background-color: var(--roblox-dark-grey);
    border: 3px solid var(--roblox-red);
    box-shadow: 
        0 15px 50px rgba(0,0,0,0.5), 
        inset 0 0 100px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    padding: 20px;
    width: 300px;
    text-align: center;
    color: white;
    border: 2px solid #E31B23;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(
        to right, 
        var(--roblox-red-bright), 
        var(--roblox-red-dark)
    );
}

.modal-content h2 {
    color: #FF424A;
}

.modal-content p {
    margin-bottom: 15px;
}

.modal-content input {
    width: calc(100% - 20px);
    padding: 10px;
    margin: 10px 0;
    background: url('/btn_greyTransp_slice7.png') repeat;
    border: 2px solid var(--roblox-grey-medium);
    box-shadow: 
        inset 0 2px 5px rgba(0,0,0,0.3),
        0 1px 2px rgba(255,255,255,0.1);
    color: var(--roblox-text-primary);
    transition: all 0.3s ease;
}

.modal-content input:focus {
    border-color: var(--roblox-red-bright);
    box-shadow: 
        0 0 10px rgba(192, 57, 43, 0.5),
        inset 0 2px 5px rgba(0,0,0,0.4);
    outline: none;
}

.modal-content button {
    background-image: url('/CloneButton.png');
    background-size: cover;
    background-color: rgba(0,0,0,0.5);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    padding: 10px 15px;
    margin-top: 15px;
    margin-bottom: 5px;
}

.modal-content button:hover {
    background: linear-gradient(to bottom, #E74C3C, #C0392B);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

button, .button {
    background: linear-gradient(to bottom, var(--roblox-red), #A52422);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

button:hover, .button:hover {
    background: linear-gradient(to bottom, #E74C3C, #C0392B);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.4), 
        inset 0 0 30px rgba(255,255,255,0.2);
}

::-webkit-scrollbar {
    width: 12px;
    background: url('/btn_grey_slice6.png') repeat;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, var(--roblox-red-bright), var(--roblox-red-dark));
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.2);
}

.texture-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: url('/DiamondPlate.png') repeat;
    opacity: 0.05;
    z-index: 9999;
}

#joystick-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 110px;
    height: 110px;
    background: rgba(30,30,30,0.32);
    border-radius: 50%;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    touch-action: none;
}

#joystick-stick {
    position: absolute;
    width: 54px;
    height: 54px;
    background: rgba(255,255,255,0.82);
    border-radius: 50%;
    border: 3px solid rgba(232,49,54,0.6);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    will-change: left, top;
    touch-action: none;
}

#mobile-jump-button {
    position: fixed;
    bottom: 32px;
    right: 28px;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #e44346 60%, #fff0ec 100%);
    color: #fff;
    border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.16);
    font-size: 38px;
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
    transition: background 0.2s;
    user-select: none;
    touch-action: none;
}

#mobile-jump-button:active {
    background: linear-gradient(135deg, #d32c35 60%, #fff0ec 100%);
}

@media (max-width: 900px) {
    #joystick-container {
        display: flex;
    }
}

@media (max-width: 900px) {
    #chat-icon {
        top: 16px;
        left: 50%;
        transform: translateX(-50%);
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 768px) {
    #joystick-container, #mobile-jump-button {
        display: block;
    }
}