body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    overflow: auto;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: none;
    overflow: hidden;
}

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

#roblox-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.3s ease;
    background-color: rgba(128, 128, 128, 0.5);
    border-radius: 8px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#roblox-logo img {
    width: 40px;
    height: 40px;
}

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

#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 selection menu styles */
#file-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, #2A2A2A, #202020);
    border-radius: 8px;
    padding: 15px;
    z-index: 30;
    width: 500px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #E31B23;
}

.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;
    cursor: pointer;
    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;
    cursor: pointer;
    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;
    cursor: pointer;
    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);
}

/* Teleport button styles */
#teleport-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: #E31B23;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 100;
}

#teleport-button:hover {
    transform: scale(1.1);
    background-color: #FF424A;
}

#teleport-button svg {
    width: 30px;
    height: 30px;
}

/* Chat UI styles */
#chat-icon {
    position: absolute;
    top: 20px;
    left: 100px;
    width: 40px;
    height: 40px;
    background-color: rgba(128, 128, 128, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
}

#chat-icon img {
    width: 24px;
    height: 24px;
}

#backpack-icon {
    position: absolute;
    top: 20px;
    left: 160px;
    width: 40px;
    height: 40px;
    background-color: rgba(128, 128, 128, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
}

#backpack-icon img {
    width: 24px;
    height: 24px;
}

#chatbox {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 350px;
    max-height: 400px;
    background-color: rgba(40, 40, 40, 0.7);
    border: 2px solid #444;
    border-radius: 8px;
    display: none;
    z-index: 150;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
#chatbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: rgba(60, 60, 60, 0.8);
    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;
    cursor: pointer;
}
#chatbox-messages {
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
    color: white;
    font-size: 14px;
    max-height: 300px;
    background-color: rgba(40, 40, 40, 0.4);
}
#chatbox-input {
    display: flex;
    border-top: 1px solid #555;
    background-color: rgba(60, 60, 60, 0.7);
}
#chatbox-input input {
    flex-grow: 1;
    padding: 5px;
    border: none;
    outline: none;
    font-size: 14px;
}
#chatbox-input button {
    background-color: #E31B23;
    border: none;
    padding: 5px 10px;
    color: white;
    cursor: pointer;
    font-size: 14px;
}
.chat-message {
    margin-bottom: 5px;
}

/* Multiplayer UI elements */
#player-list {
    display: none; 
}

#game-mode-indicator {
    display: none; 
}

#singleplayer-button {
    display: none; 
}

#leaderboard-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(128, 128, 128, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 5px;
    transition: transform 0.2s ease;
}

#leaderboard-button:hover {
    transform: scale(1.1);
}

#leaderboard-button img {
    width: 24px;
    height: 24px;
}

#leaderboard-panel {
    position: absolute;
    top: 70px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background-color: rgba(40, 40, 40, 0.85);
    border: 2px solid #555;
    border-radius: 8px;
    z-index: 150;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#leaderboard-panel.visible {
    display: flex;
}

.leaderboard-header {
    padding: 10px;
    font-weight: bold;
    color: white;
    background-color: rgba(60, 60, 60, 0.9);
    border-bottom: 1px solid #666;
    text-align: center;
}

.leaderboard-players {
    overflow-y: auto;
    max-height: 350px;
}

.leaderboard-player {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #555;
}

.leaderboard-player:last-child {
    border-bottom: none;
}

.leaderboard-player.current-player {
    background-color: rgba(227, 27, 35, 0.2);
    border-left: 3px solid #E31B23;
}

.leaderboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #777;
}

.leaderboard-player-info {
    flex: 1;
}

.leaderboard-name {
    color: white;
    font-weight: bold;
    margin-bottom: 2px;
}

.leaderboard-map {
    color: #aaa;
    font-size: 12px;
}

/* Notification system */
#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-color: rgba(40, 40, 40, 0.8);
    color: white;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 3px solid #E31B23;
    width: 100%;
    text-align: center;
    animation: slide-in 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.notification.fade-out {
    animation: fade-out 1s ease;
}

@keyframes slide-in {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

#hotbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(40, 40, 40, 0.5);
    padding: 5px;
    display: flex;
    z-index: 50;
    gap: 4px;
}

.hotbar-item {
    margin: 0;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background-color: rgba(30, 30, 30, 0.7);
}

.hotbar-item::before {
    content: attr(data-slot);
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 12px;
    color: white;
    z-index: 2;
}

.hotbar-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.hotbar-item:hover {
    transform: scale(1.1);
}

.hotbar-item.active {
    border: 2px solid #E31B23;
}

/* NEW: UI for paint tool and build tool placed at the bottom left */
#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;
}
#paint-tool-ui button,
#build-tool-ui button {
    margin: 5px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}
#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;
}

/* NEW: Style for the paintball hit overlay */
#paintball-hit-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

/* NEW: Style for highlighting when scaling */
.scaling-active {
    cursor: ew-resize;
}

/* Add style for the scale and move tool handles */
.handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #0088ff;
    border-radius: 50%;
    cursor: grab;
}

/* NEW: Styles for mobile joystick UI */
#joystick-container {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 110;
    touch-action: none;
}
#joystick-stick {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    touch-action: none;
}

/* NEW: Tutorial overlay styles */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#tutorial-panel {
    background: #2A2A2A;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    text-align: center;
    color: white;
}

#tutorial-panel h2 {
    margin-top: 0;
    font-size: 24px;
}

#tutorial-panel p {
    font-size: 16px;
    margin: 10px 0;
}

#tutorial-panel button {
    background-color: #E31B23;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

#tutorial-panel button:hover {
    background-color: #FF424A;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(40, 40, 40, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    background-image: url('https://cdn.discordapp.com/attachments/1344305215674908824/1345503637128089631/hb3gc8e3wzl61_cleanup.png?ex=67c4c969&is=67c377e9&hm=ad51f5aa1bae6d38666dc8e8e37ebb6fc5e23d8eeddd0c8f30e237f7cb8667a3&');
}

#loading-spinner {
    width: 80px;
    height: 80px;
    position: absolute;
    bottom: 30px;
    right: 30px;
    animation: spin 1s linear infinite;
}

#loading-cancel {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

#loading-cancel:hover {
    transform: scale(1.1);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#game-title {
    color: white;
    font-size: 32px;
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
}

#game-thumbnail {
    max-width: 80%;
    max-height: 300px;
    margin-bottom: 30px;
    border: 3px solid #E31B23;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#loading-screen.fade-out {
    opacity: 0;
    transition: opacity 1s ease;
}

/* New Roblox-style UI Menu System */
.roblox-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-height: 80vh;
    background-color: rgba(35, 37, 39, 0.9);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    overflow: hidden;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.roblox-menu-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.roblox-menu-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    flex-grow: 1;
}

.roblox-menu-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.roblox-menu-close:hover {
    color: white;
}

.roblox-menu-tabs {
    display: flex;
    background-color: rgba(40, 42, 45, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.roblox-menu-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
}

.roblox-menu-tab:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

.roblox-menu-tab.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 -2px 0 #0081ff;
}

.roblox-menu-content {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.roblox-menu-tab-content {
    display: none;
}

.roblox-menu-tab-content.active {
    display: block;
}

/* Players tab content styling */
.player-list-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: rgba(45, 47, 50, 0.5);
    transition: background-color 0.2s ease;
}

.player-list-item:hover {
    background-color: rgba(60, 62, 65, 0.5);
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
}

.player-info {
    flex-grow: 1;
}

.player-name {
    color: white;
    font-weight: 500;
    margin-bottom: 2px;
}

.player-details {
    color: #aaa;
    font-size: 12px;
}

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

.player-action-btn {
    background-color: rgba(60, 62, 65, 0.7);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.player-action-btn:hover {
    background-color: rgba(80, 82, 85, 0.7);
}

.player-action-btn.friend {
    background-color: rgba(0, 129, 255, 0.7);
}

.player-action-btn.friend:hover {
    background-color: rgba(0, 129, 255, 0.9);
}

/* Settings tab content styling */
.settings-section {
    margin-bottom: 20px;
}

.settings-section-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background-color: rgba(45, 47, 50, 0.5);
    border-radius: 6px;
}

.setting-label {
    color: white;
}

.setting-control {
    min-width: 120px;
}

.setting-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    border-radius: 4px;
    background: rgba(60, 62, 65, 0.7);
    outline: none;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0081ff;
    cursor: pointer;
}

.setting-dropdown {
    width: 100%;
    padding: 6px 8px;
    background-color: rgba(60, 62, 65, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.setting-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #0081ff;
}

/* Help tab content styling */
.help-section {
    margin-bottom: 20px;
}

.help-section-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.help-content {
    color: #ddd;
    line-height: 1.5;
    margin-bottom: 15px;
}

.help-control-list {
    background-color: rgba(45, 47, 50, 0.5);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
}

.help-control-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.help-control-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.help-key {
    background-color: rgba(60, 62, 65, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
}

.help-action {
    color: white;
}

.help-credits {
    text-align: center;
    color: #aaa;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Action buttons in the Roblox menu */
.roblox-menu-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    background-color: rgba(35, 37, 39, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.roblox-action-btn {
    flex: 1;
    padding: 10px;
    background-color: rgba(60, 62, 65, 0.8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.roblox-action-btn:hover {
    background-color: rgba(80, 82, 85, 0.8);
}

.roblox-action-btn.danger {
    background-color: rgba(227, 27, 35, 0.7);
}

.roblox-action-btn.danger:hover {
    background-color: rgba(227, 27, 35, 0.9);
}