﻿body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #333;
}

/* Deploy toast notification */
.deploy-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 14px;
    z-index: 10000;
    display: none;
    transition: opacity 0.4s ease;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.toast-success {
    background: #1a3a1a;
    color: #66cc66;
    border: 1px solid #339933;
}
.toast-error {
    background: #3a1a1a;
    color: #cc6666;
    border: 1px solid #993333;
}

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

canvas {
    display: block;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

#info-panel {
    position: absolute;
    top: 60px;
    left: 20px;
    background-color: #252E1C;
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    z-index: 10;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
}


#poly-panel {
    position: fixed;
    top: 138px;
    left: 20px;
    background-color: #252E1C;
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    z-index: 10;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    max-height: 85vh;
    overflow-y: auto;
    max-width: calc(20% - 20px);
    min-width: 300px;
}

    #poly-panel h3 {
        margin-top: 0;
        margin-bottom: 16px; /* Increased spacing */
    }

    #poly-panel > div {
        margin-bottom: 16px; /* Increased spacing between sections */
        padding-bottom: 4px;
    }

        /* Add a subtle separator between property sections */
        #poly-panel > div:not(:last-child) {
            border-bottom: 1px dotted #555;
            padding-bottom: 16px;
        }

    #poly-panel label {
        display: inline-block;
        width: 60px;
    }

.controls {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 50px;
    background-color: #252E1C;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    justify-content: center;
    flex-wrap: nowrap;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Grid controls */
.controls .grid-size-input {
    width: 48px;
    height: 28px;
    background-color: #252E1C;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    text-align: center;
    font-family: monospace;
    font-size: 12px;
    padding: 0 2px;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.controls .grid-size-input:focus {
    outline: none;
    border-color: #BBCC66;
}

.controls .grid-size-input::-webkit-inner-spin-button {
    opacity: 0.5;
}

.controls button.grid-active {
    color: #BBCC66;
    border-color: #BBCC66;
}

/* Separator style */
.controls .separator {
    width: 1px;
    height: 24px;
    background-color: #555;
    margin: 0 4px;
    flex-shrink: 0;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    .controls {
        left: 0;
        transform: none;
        width: 100%;
        padding: 8px;
        border-radius: 0;
        height: auto;
        flex-wrap: wrap;
    }
}

/* Button styling */
.controls button {
    background-color: #252E1C;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    flex-shrink: 0;
    min-width: 36px;
    transition: all 0.2s ease; /* Smooth transition for hover effects */
}

    .controls button:hover {
        color: #BBCC66;
        border-color: #BBCC66;
        transform: translateY(-2px); /* Slight lift effect on hover */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Shadow on hover */
    }

    .controls button:active {
        transform: translateY(1px); /* Press effect */
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

    /* Tooltip on hover - styled to match other elements */
    .controls button:hover::after {
        content: attr(title);
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        background-color: #252E1C;
        color: white;
        padding: 5px 10px;
        border-radius: 5px;
        margin-top: 5px;
        z-index: 101;
        white-space: nowrap;
        font-size: 12px;
        font-family: monospace;
        box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2); /* Match other elements' shadow */
        border: 1px solid #555;
        opacity: 0;
        animation: tooltip-fade 0.2s ease forwards; /* Fade in animation */
    }

/* Tooltip fade-in animation */
@keyframes tooltip-fade {
    from {
        opacity: 0;
        transform: translate(-50%, -5px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}



#triangle-type, #triangle-color {
    background: #252E1C;
    color: #fff;
    border: 1px solid #555;
    padding: 4px;
    width: 100%;
}

    #triangle-type::-webkit-scrollbar,
    #info-panel::-webkit-scrollbar,
    #poly-panel::-webkit-scrollbar,
    .texture-grid::-webkit-scrollbar {
        width: 5px;
    }

    #triangle-type::-webkit-scrollbar-track,
    #info-panel::-webkit-scrollbar-track,
    #poly-panel::-webkit-scrollbar-track,
    .texture-grid::-webkit-scrollbar-track {
        background: transparent;
        border-radius: 5px;
    }

    #triangle-type::-webkit-scrollbar-thumb,
    #info-panel::-webkit-scrollbar-thumb,
    #poly-panel::-webkit-scrollbar-thumb,
    .texture-grid::-webkit-scrollbar-thumb {
        background: #555;
        border-radius: 5px;
    }

        #triangle-type::-webkit-scrollbar-thumb:hover,
        #info-panel::-webkit-scrollbar-thumb:hover,
        #poly-panel::-webkit-scrollbar-thumb:hover,
        .texture-grid::-webkit-scrollbar-thumb:hover {
            background: #BBCC66;
        }

#vertex-coordinates {
    font-size: 0.9em;
    color: #ddd;
    margin-top: 5px;
    padding-left: 65px;
}

/* Texture styles matching the theme */
.texture-grid {
    display: grid;
    grid-template-columns: repeat(4, 0.25fr);
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: #252E1C;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid #555;
}

.texture-item {
    position: relative;
    cursor: pointer;
    border: 2px solid #555;
    border-radius: 4px;
    transition: all 0.2s ease;
    aspect-ratio: 1/1;
    overflow: hidden;
}

    .texture-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .texture-item:hover {
        transform: scale(1.05);
        border-color: #BBCC66;
    }

    .texture-item.selected {
        border-color: #BBCC66;
        box-shadow: 0 0 5px #BBCC66;
    }

.texture-error, .no-textures {
    color: #ddd;
    padding: 10px;
    text-align: center;
}

.search-container {
    margin-bottom: 10px;
}

#texture-search {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #252E1C;
    color: white;
}

#texture-controls {
    margin-top: 15px;
    padding: 10px;
    background-color: #252E1C;
    border-radius: 5px;
    border: 1px solid #555;
}

.control-group {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

    .control-group label {
        width: 100px;
        display: inline-block;
    }

    .control-group input[type="range"] {
        flex: 1;
        margin: 0 10px;
    }

    .control-group span {
        width: 50px;
        text-align: right;
    }

#reset-texture, #remove-texture {
    margin-top: 10px;
    margin-right: 10px;
    padding: 5px 10px;
    background-color: #252E1C;
    border: 1px solid #555;
    color: white;
    border-radius: 3px;
    cursor: pointer;
}

    #reset-texture:hover, #remove-texture:hover {
        color: #BBCC66;
        border-color: #BBCC66;
    }

#remove-texture {
    background-color: #6b2b2b;
}

    #remove-texture:hover {
        background-color: #8a3636;
        color: white;
    }

/* Settings Panel Styles */
#settings-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    background-color: #252E1C;
    color: white;
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    z-index: 10;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
    width: 300px;
}

    #settings-panel h3 {
        margin-top: 0;
        margin-bottom: 16px;
    }

    #settings-panel > div {
        margin-bottom: 16px;
        padding-bottom: 4px;
    }

        #settings-panel > div:not(:last-child) {
            border-bottom: 1px dotted #555;
            padding-bottom: 16px;
        }

    #settings-panel label {
        display: inline-block;
        width: 100%;
    }

    #settings-panel input[type="text"],
    #settings-panel select {
        background: #252E1C;
        color: #fff;
        border: 1px solid #555;
        padding: 4px;
        width: 100%;
        box-sizing: border-box;
    }

.map-name-container {
    display: flex;
    align-items: center;
    background: #252E1C;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 0 4px;
    margin-top: 4px;
}

.map-name-prefix {
    color: #BBCC66;
    font-weight: bold;
    padding-right: 2px;
    user-select: none;
}

#map-name {
    border: none !important;
    padding: 4px 0 !important;
    flex: 1;
}

    #map-name:focus {
        outline: none;
    }

.map-name-container:focus-within {
    border-color: #BBCC66;
}

.bg-color-controls {
    margin-top: 10px;
}

    .bg-color-controls .control-group {
        margin-bottom: 8px;
    }

input[type="color"] {
    width: 50px;
    height: 30px;
    padding: 0;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rgba-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-left: 10px;
    width: 60%;
}

    .rgba-inputs span {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Custom styling for RGBA number inputs */
    .rgba-inputs input[type="number"] {
        background-color: #252E1C;
        color: white;
        border: 1px solid #555;
        border-radius: 4px;
        text-align: center;
        transition: all 0.2s ease;
        height: 24px;
        width: 45px;
    }
        .rgba-inputs input[type="number"]:focus {
            background-color: #252E1C;
            color: white;
            outline: none;
            border-color: #BBCC66;
            box-shadow: 0 0 5px rgba(138, 54, 54, 0.5);
        }

        /* Hide default spinners first */
        .rgba-inputs input[type="number"]::-webkit-inner-spin-button,
        .rgba-inputs input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

/* Help panel styles */
#help-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    background-color: #252E1C;
    color: white;
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    z-index: 10;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
    width: 400px;
    display: none; /* Initially hidden */
}

    #help-panel h3 {
        margin-top: 0;
        margin-bottom: 16px;
        border-bottom: 1px dotted #555;
        padding-bottom: 10px;
    }

    #help-panel h4 {
        color: #64c8ff;
        margin: 15px 0 5px 0;
    }

    #help-panel .help-section {
        margin-bottom: 16px;
        padding-bottom: 4px;
    }

        #help-panel .help-section:not(:last-child) {
            border-bottom: 1px dotted #555;
            padding-bottom: 16px;
        }

    #help-panel ul {
        padding-left: 20px;
    }

    #help-panel li {
        margin-bottom: 5px;
    }

    #help-panel p {
        margin: 5px 0;
        line-height: 1.4;
    }

    #help-panel .help-footer {
        font-size: 0.9em;
        color: #999;
    }

    #help-panel a {
        color: #64c8ff;
        text-decoration: none;
    }

        #help-panel a:hover {
            text-decoration: underline;
            color: #BBCC66;
        }

    /* scrollbar styles to help panel */
    #help-panel::-webkit-scrollbar {
        width: 5px;
    }

    #help-panel::-webkit-scrollbar-track {
        background: transparent;
        border-radius: 5px;
    }

    #help-panel::-webkit-scrollbar-thumb {
        background: #555;
        border-radius: 5px;
    }

        #help-panel::-webkit-scrollbar-thumb:hover {
            background: #BBCC66;
        }


/* Simplified Primitives Panel CSS */
#primitives-panel {
    position: fixed;
    left: 20px;
    top: 60px;
    width: 300px;
    background-color: #252E1C;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 15px;
    color: white;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    max-height: 80vh;
    overflow-y: auto;
}

    #primitives-panel h3 {
        margin-top: 0;
        margin-bottom: 15px;
        border-bottom: 1px dotted #555;
        padding-bottom: 10px;
    }

.primitive-shapes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.primitive-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #252E1C;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
}

    .primitive-item:hover {
        border-color: #BBCC66;
        transform: translateY(-2px);
    }

    .primitive-item.selected {
        border-color: #BBCC66;
        background-color: #3a4a2c;
        box-shadow: 0 0 5px rgba(187, 204, 102, 0.3);
    }

    .primitive-item i {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .primitive-item span {
        font-size: 11px;
    }

 /* Styles for Type */
#primitive-type {
    background: #252E1C;
    color: #fff;
    border: 1px solid #555;
    padding: 4px;
    width: 100%;
    font-family: monospace;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    #primitive-type:hover {
        border-color: #BBCC66;
    }

    #primitive-type:focus {
        outline: none;
        border-color: #BBCC66;
        box-shadow: 0 0 5px rgba(187, 204, 102, 0.5);
    }

    /* Add the scrollbar styling to match other elements */
    #primitive-type::-webkit-scrollbar {
        width: 5px;
    }

    #primitive-type::-webkit-scrollbar-track {
        background: transparent;
        border-radius: 5px;
    }

    #primitive-type::-webkit-scrollbar-thumb {
        background: #555;
        border-radius: 5px;
    }

        #primitive-type::-webkit-scrollbar-thumb:hover {
            background: #BBCC66;
        }


/* Style for controls within the panel */
.primitive-controls .control-group {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.primitive-controls label {
    width: 100px;
}

.primitive-controls input[type="range"] {
    flex: 1;
    margin: 0 10px;
}

.primitive-controls span {
    width: 40px;
    text-align: right;
}

.checkbox-control {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

    .checkbox-control label {
        margin-right: 10px;
        color: white;
    }

    .checkbox-control input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 18px;
        height: 18px;
        background-color: #252E1C;
        border: 1px solid #555;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
        outline: none;
    }

        .checkbox-control input[type="checkbox"]:hover {
            border-color: #BBCC66;
            box-shadow: 0 0 3px rgba(187, 204, 102, 0.3);
        }

        .checkbox-control input[type="checkbox"]:checked {
            background-color: #252E1C;
            border-color: #BBCC66;
        }

            .checkbox-control input[type="checkbox"]:checked::after {
                content: "";
                position: absolute;
                left: 5px;
                top: 2px;
                width: 6px;
                height: 10px;
                border: solid #BBCC66;
                border-width: 0 2px 2px 0;
                transform: rotate(45deg);
            }

        .checkbox-control input[type="checkbox"]:focus {
            border-color: #BBCC66;
            box-shadow: 0 0 5px rgba(187, 204, 102, 0.5);
        }

/* Custom slider styling to match the dark theme */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 80%;
    height: 6px;
    background: #444;
    border-radius: 3px;
    outline: none;
    transition: all 0.2s ease;
    margin: 0 10px;
}

    /* Thumb styles (the draggable part) */
    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 16px;
        height: 16px;
        background: #64c8ff;
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid #252E1C;
        transition: all 0.2s ease;
    }


    /* Hover states */
    input[type="range"]:hover {
        background: #555;
    }

        input[type="range"]:hover::-webkit-slider-thumb {
            background: #BBCC66;
            transform: scale(1.1);
        }


    /* Active states */
    input[type="range"]:active::-webkit-slider-thumb {
        background: #BBCC66;
        transform: scale(1.2);
        box-shadow: 0 0 5px rgba(187, 204, 102, 0.5);
    }


    /* Focus states */
    input[type="range"]:focus {
        background: #555;
    }

        input[type="range"]:focus::-webkit-slider-thumb {
            border-color: #BBCC66;
            box-shadow: 0 0 5px rgba(187, 204, 102, 0.5);
        }


/* Value display styling */
.control-group span {
    color: #ddd;
    font-family: monospace;
    transition: color 0.2s ease;
    width: 50px;
    text-align: right;
}

.control-group:hover span {
    color: #BBCC66;
}

/* Consistent control group styling */
.control-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

    .control-group label {
        width: 100px;
        color: white;
        font-family: monospace;
    }

/* scrollbar for panel primitives */
#primitives-panel::-webkit-scrollbar {
    width: 5px;
}

#primitives-panel::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 5px;
}

#primitives-panel::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

    #primitives-panel::-webkit-scrollbar-thumb:hover {
        background: #BBCC66;
    }

/* Scenery Panel Styles */
#scenery-panel,
#texture-panel {
    position: fixed;
    left: 20px;
    top: 60px;
    width: 320px;
    background-color: #252E1C;
    border: 1px solid transparent;
    border-radius: 5px;
    padding: 15px;
    color: white;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    max-height: 80vh;
    overflow-y: auto;
    font-family: monospace;
}

#scenery-panel {
    width: 420px;
}

    #scenery-panel h3,
    #texture-panel h3 {
        margin-top: 0;
        margin-bottom: 15px;
        border-bottom: 1px dotted #555;
        padding-bottom: 10px;
    }

/* Texture grid inside poly-panel — responsive, visual */
.poly-texture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
    padding: 6px;
    background: linear-gradient(135deg, #1e2618 0%, #1a2014 100%);
    border-radius: 6px;
    border: 1px solid #444;
    margin: 8px 0;
}

.poly-texture-grid .texture-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #2a3520;
    position: static;
    aspect-ratio: auto;
}

.poly-texture-grid .texture-item:hover {
    border-color: #BBCC66;
    background: #3a4a2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.poly-texture-grid .texture-item.selected {
    border-color: #BBCC66;
    box-shadow: 0 0 8px rgba(187, 204, 102, 0.5);
    background: #3a4a2c;
}

.poly-texture-grid .texture-item img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    background: repeating-conic-gradient(#333 0% 25%, #444 0% 50%) 50% / 10px 10px;
    transition: transform 0.2s ease;
}

.poly-texture-grid .texture-item:hover img {
    transform: scale(1.05);
}

.poly-texture-label {
    font-size: 9px;
    color: #999;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    transition: color 0.2s;
}

.poly-texture-grid .texture-item:hover .poly-texture-label {
    color: #BBCC66;
}

.poly-texture-grid::-webkit-scrollbar {
    width: 5px;
}

.poly-texture-grid::-webkit-scrollbar-track {
    background: transparent;
}

.poly-texture-grid::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

.poly-texture-grid::-webkit-scrollbar-thumb:hover {
    background: #BBCC66;
}

#poly-panel #texture-search {
    padding: 8px 10px;
    font-size: 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    border: 1px solid #555;
    background: #1e2618;
    color: white;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#poly-panel #texture-search:focus {
    outline: none;
    border-color: #BBCC66;
    box-shadow: 0 0 5px rgba(187, 204, 102, 0.3);
}

#poly-panel #texture-search::placeholder {
    color: #666;
}

.texture-upload-btn-sm {
    width: 100%;
    padding: 5px;
    background-color: #252E1C;
    border: 1px solid #555;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    font-size: 11px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

.texture-upload-btn-sm:hover {
    border-color: #BBCC66;
    color: #BBCC66;
}

.scenery-search-container {
    margin-bottom: 10px;
}

#scenery-search,
#texture-search {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #252E1C;
    color: white;
    font-family: monospace;
    box-sizing: border-box;
}

    #scenery-search::placeholder,
    #texture-search::placeholder {
        color: #888;
    }

.scenery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 450px;
    overflow-y: auto;
    padding: 4px;
    background-color: #1e2618;
    border-radius: 4px;
    border: 1px solid #555;
    margin-bottom: 10px;
}

.scenery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: #252E1C;
}

    .scenery-item:hover {
        border-color: #BBCC66;
        transform: translateY(-1px);
    }

    .scenery-item.selected {
        border-color: #BBCC66;
        box-shadow: 0 0 5px rgba(187, 204, 102, 0.5);
        background: #3a4a2c;
    }

    .scenery-item img {
        width: 100%;
        aspect-ratio: 1/1;
        object-fit: contain;
        border-radius: 2px;
        background: repeating-conic-gradient(#333 0% 25%, #444 0% 50%) 50% / 12px 12px;
    }

.scenery-label {
    font-size: 9px;
    color: #aaa;
    margin-top: 3px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.scenery-grid::-webkit-scrollbar {
    width: 5px;
}

.scenery-grid::-webkit-scrollbar-track {
    background: transparent;
}

.scenery-grid::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

    .scenery-grid::-webkit-scrollbar-thumb:hover {
        background: #BBCC66;
    }

.scenery-upload-section {
    margin-bottom: 10px;
}

.scenery-upload-btn {
    width: 100%;
    padding: 8px;
    background-color: #252E1C;
    border: 1px solid #555;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .scenery-upload-btn:hover {
        border-color: #BBCC66;
        color: #BBCC66;
    }

.scenery-rules {
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px;
    font-size: 11px;
    color: #ccc;
}

    .scenery-rules summary {
        cursor: pointer;
        color: #BBCC66;
        font-size: 12px;
        padding: 4px 0;
        list-style: none;
    }

        .scenery-rules summary::before {
            content: '\25B6 ';
            font-size: 10px;
        }

    .scenery-rules[open] summary::before {
        content: '\25BC ';
    }

    .scenery-rules ul {
        padding-left: 16px;
        margin: 8px 0 0 0;
    }

    .scenery-rules li {
        margin-bottom: 6px;
        line-height: 1.4;
    }

#scenery-panel::-webkit-scrollbar,
#texture-panel::-webkit-scrollbar {
    width: 5px;
}

#scenery-panel::-webkit-scrollbar-track,
#texture-panel::-webkit-scrollbar-track {
    background: transparent;
}

#scenery-panel::-webkit-scrollbar-thumb,
#texture-panel::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

    #scenery-panel::-webkit-scrollbar-thumb:hover,
    #texture-panel::-webkit-scrollbar-thumb:hover {
        background: #BBCC66;
    }

/* Texture notification banner */
#texture-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #252E1C;
    border: 1px solid #ffc107;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: monospace;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    max-width: 600px;
}

#texture-notification .notif-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

#dismiss-texture-notif {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
    line-height: 1;
}

    #dismiss-texture-notif:hover {
        color: #fff;
    }

/* Exit button styling */
#exit-btn {
    background-color: #3a2020 !important;
    border-color: #dc3545 !important;
}

    #exit-btn:hover {
        background-color: #5a2020 !important;
        color: #dc3545 !important;
        border-color: #dc3545 !important;
    }

/* ===================== CLOUD MAPS MODAL ===================== */
#cloud-maps-modal,
#cloud-save-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.cloud-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.cloud-modal-content {
    position: relative;
    background: #1a2312;
    border: 1px solid rgba(187, 204, 102, 0.3);
    border-radius: 10px;
    width: 400px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.cloud-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(187, 204, 102, 0.15);
}

.cloud-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #BBCC66;
}

.cloud-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.cloud-modal-close:hover {
    color: #fff;
}

.cloud-maps-list {
    overflow-y: auto;
    padding: 10px;
    flex: 1;
}

.cloud-map-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(85, 85, 85, 0.3);
    border-radius: 6px;
    margin-bottom: 6px;
    transition: border-color 0.2s;
}

.cloud-map-item:hover {
    border-color: rgba(187, 204, 102, 0.4);
}

.cloud-map-name {
    flex: 1;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cloud-map-date {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}

.cloud-map-load-btn {
    background: none;
    border: 1px solid #BBCC66;
    color: #BBCC66;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.cloud-map-load-btn:hover {
    background: #BBCC66;
    color: #1a2312;
}

/* Cloud Save Modal Body */
.cloud-save-body {
    padding: 18px;
}

.cloud-save-body label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 13px;
}

.cloud-save-name-container {
    display: flex;
    align-items: center;
    background: #252E1C;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 0 10px;
    margin-bottom: 18px;
    transition: border-color 0.2s;
}

.cloud-save-name-container:focus-within {
    border-color: #BBCC66;
}

.cloud-save-prefix {
    color: #BBCC66;
    font-weight: bold;
    user-select: none;
    padding-right: 2px;
}

#cloud-save-name {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px 4px;
    font-family: monospace;
    font-size: 14px;
    outline: none;
}

.cloud-save-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cloud-save-cancel-btn {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    border-radius: 6px;
    padding: 8px 18px;
    cursor: pointer;
    font-family: monospace;
    font-size: 13px;
    transition: all 0.2s;
}

.cloud-save-cancel-btn:hover {
    border-color: #888;
    color: #fff;
}

.cloud-save-confirm-btn {
    background: rgba(187, 204, 102, 0.15);
    border: 1px solid #BBCC66;
    color: #BBCC66;
    border-radius: 6px;
    padding: 8px 18px;
    cursor: pointer;
    font-family: monospace;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cloud-save-confirm-btn:hover {
    background: #BBCC66;
    color: #1a2312;
}

.cloud-save-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===================== LOGIN REQUIRED MODAL ===================== */
#login-required-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.login-modal-body {
    padding: 24px;
    text-align: center;
}

.login-modal-body p {
    color: #ccc;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.login-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.login-modal-actions a {
    text-decoration: none;
}

