/* --- Global Styles & Variables --- */
:root {
    --primary-color: #4a90e2;
    --background-color: #e9eef2;
    --surface-color: rgba(255, 255, 255, 0.85);
    --text-color: #333;
    --highlight-color: #ff9f1c;
    --connection-color: #888;
    --font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden; /* Critical for full-screen canvas */
}

/* --- App Layout --- */
#app-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Floating Controls --- */
#controls {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background-color: var(--surface-color);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    align-items: center;
}

.hint {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

/* --- Control Elements Styling --- */
input[type="text"], input[type="search"], input[type="password"] {
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="search"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

button {
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.4);
}

/* --- Editor & Modal Styling --- */
.modal-overlay, #ball-editor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

#ball-editor {
    position: fixed; /* Use fixed for editor too */
    z-index: 30;
}

.modal-content, .editor-content { /* Shared class for content styling */
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 25px;
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#ball-editor { /* Remove modal overlay styles from editor itself */
    background: none;
    backdrop-filter: none;
    box-shadow: none;
    border: none;
}

.modal-content h3, #editor-title {
    margin: 0;
    text-align: center;
    color: var(--primary-color);
    font-size: 24px;
}

#ball-text {
    width: calc(100% - 30px);
    min-height: 100px;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 15px;
    font-size: 16px;
    resize: vertical;
}

.hidden {
    display: none !important;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    #controls {
        flex-direction: column;
        width: 90%;
        top: 10px;
    }
    .hint { display: none; } /* Hide hint on small screens */
}