body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent scrolling */
    background-color: #1a1a1a;
    font-family: sans-serif;
    color: white;
}

/* Canvas Container */
#canvas-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
}

/* Login Overlay */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: #333;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

/* Footer Credit */
.footer-credit {
    position: fixed;
    bottom: 5px;
    right: 5px;
    font-family: sans-serif;
    font-size: 10px;
    color: white;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.7;
}

input {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    border: none;
    width: 80%;
}

button {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
}

button:hover {
    background: #45a049;
}

/* GM Controls */
#gm-controls {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    min-width: 320px;
    max-width: 90vw;
    background: rgba(0, 0, 0, 0.85);
    padding: 0;
    border-radius: 5px;
    z-index: 100;
    display: none;
    border: 1px solid #444;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#gm-controls-header {
    background: #444;
    padding: 10px;
    cursor: move;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

#gm-controls-content {
    padding: 10px;
    max-height: 80vh;
    overflow-y: auto;
}

#gm-controls.minimized #gm-controls-content {
    display: none;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.control-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Toolbar Styles */
.tools-section {
    margin-top: 10px;
    border-top: 1px solid #555;
    padding-top: 10px;
}

.tool-row {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    align-items: center;
}

.color-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    background: #222;
    padding: 5px;
    border-radius: 4px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-swatch.active {
    border-color: white;
}

.shape-btn {
    padding: 5px 10px;
    background: #555;
    border: 2px solid #777;
    /* Increased border width for visibility */
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 4px;
    /* Rounded for better look */
}

.shape-btn.active {
    background: #4CAF50;
    border-color: #fff;
    /* White border for active */
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    /* Glow */
}

/* Specific overrides for colored buttons to keep their color but show active border */
.shape-btn[style*="background: #2196f3"].active {
    background: #2196f3 !important;
    border-color: #fff !important;
    box-shadow: 0 0 8px #2196f3;
}

.shape-btn[style*="background: #e91e63"].active {
    background: #e91e63 !important;
    border-color: #fff !important;
    box-shadow: 0 0 8px #e91e63;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 5px;
}