body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: sans-serif;
}

#editor-container {
    width: 100%;
    height: 100%;
    /* Gradient from dark blue up high to light blue down low */
    background: linear-gradient(to bottom, #009dff, #9fb6e0);
}

canvas {
    display: block;
}

#right-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 220px;
    background: #222;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    overflow-y: auto;
}

#right-panel.closed {
    transform: translateX(100%);
}

#toggle-panel {
    position: absolute;
    left: -30px;
    top: 10px;
    width: 30px;
    height: 40px;
    background: #222;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px 0 0 5px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-content {
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
    align-items: center;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.sidebar-section {
    width: 100%;
    margin-bottom: 10px;
}

.section-title {
    color: #cfd4da;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 8px 4px;
}

.toolbar {
    display: grid;
    grid-template-columns: repeat(4, 40px);
    justify-content: center;
    gap: 10px;
}

.tool-btn, #export-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border: 2px solid transparent;
    background: #444;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tool-btn:hover, #export-btn:hover {
    background: #555;
}

.tool-btn.active {
    border-color: #00ffcc;
    background: #333;
}

#export-modal, #settings-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#export-modal.hidden, #settings-modal.hidden {
    display: none;
}

.modal-content {
    background: #333;
    color: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.modal-content h3 {
    margin: 0;
}

#json-output {
    width: 100%;
    height: 300px;
    font-family: monospace;
    resize: none;
    background: #222;
    color: #00ffcc;
    border: 1px solid #555;
    padding: 10px;
    box-sizing: border-box;
}

#close-modal, #close-settings-modal {
    align-self: flex-end;
    padding: 8px 16px;
    background: #555;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#close-modal:hover, #close-settings-modal:hover {
    background: #666;
}

#settings-modal label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

#settings-modal input {
    background: #222;
    color: #00ffcc;
    border: 1px solid #555;
    padding: 5px;
    border-radius: 4px;
}

/* Properties Panel at Bottom */
#properties-panel {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease-in-out;
    z-index: 10;
}

#properties-panel.closed {
    transform: translate(-50%, 100%);
}

#properties-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
}

#prop-blockColor {
    background: transparent;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    width: 40px;
    height: 30px;
}

#mobile-notice {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #121212;
    z-index: 99999;
    color: white;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    padding: 30px;
}

#mobile-notice i {
    font-size: 6rem;
    color: #ff4444;
    margin-bottom: 25px;
}

#mobile-notice h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    margin-top: 0;
}

#mobile-notice p {
    font-size: 1.2rem;
    line-height: 1.5;
    color: #ccc;
    max-width: 400px;
}

@media (max-width: 900px) and (pointer: coarse), (max-width: 600px) {
    #mobile-notice {
        display: flex;
    }
    #editor-container, #right-panel, #tutorial-btn, .bottom-tools, #properties-panel {
        display: none !important;
    }
}
