:root {
    --bg-color: #1a1a1a;
    --panel-color: #252525;
    --text-color: #ffffff;
    --accent-color: #4CAF50;
    --slot-size: 80px;
    --bubble-size: 60px;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection in inputs/textareas despite global user-select: none */
input, textarea {
    user-select: text;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Main Menu */
.menu-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    z-index: 200;
}

.title {
    font-size: 3rem;
    background: linear-gradient(45deg, #FF0000, #00FF00, #0000FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
    font-weight: 800;
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 300px;
}

.menu-btn {
    padding: 20px;
    font-size: 1.2rem;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.menu-footer {
    position: absolute;
    bottom: 20px;
    color: #666;
    font-size: 0.8rem;
}

.back-button {
    position: absolute;
    top: 60px; /* Below bug button */
    left: 15px;
    padding: 5px 10px;
    font-size: 12px;
    background: #444;
    z-index: 50;
    border-radius: 8px;
}

.disclaimer {
    text-align: center;
    font-size: 11px;
    color: #888;
    padding: 8px 0 2px 0;
    width: 100%;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

/* Mixing Stage (Top) */
.mixing-stage {
    flex: 0 0 auto;
    background-color: var(--bg-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
}

.equation-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap; 
    justify-content: center;
}

.sign {
    font-size: 32px;
    font-weight: bold;
    color: #888;
}

.slot.result.waiting {
    border-style: dashed;
    background-color: transparent;
    color: #555;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.slot {
    width: var(--slot-size);
    height: var(--slot-size);
    border-radius: 50%;
    border: 3px dashed #555;
    background-color: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.slot.filled {
    border-style: solid;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.slot.active {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.plus-sign, .equals-sign {
    font-size: 24px;
    font-weight: bold;
    color: #666;
}

/* Removed preview-container styles */

.color-bubble {
    width: var(--bubble-size);
    height: var(--bubble-size);
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2), 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.1s;
}

.color-bubble:active {
    transform: scale(0.9);
}

.color-bubble.large {
    width: var(--slot-size);
    height: var(--slot-size);
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

button {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#mix-btn {
    background-color: var(--accent-color);
}

#mix-btn:active:not(:disabled) {
    background-color: #388E3C;
}

#message-area {
    height: 20px;
    font-size: 14px;
    color: #888;
    text-align: center;
    transition: color 0.3s;
}

/* Inventory (Bottom) */
.inventory-section {
    flex: 1;
    background-color: var(--panel-color);
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inventory-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #aaa;
    border-bottom: 1px solid #333;
}

#reset-save {
    font-size: 12px;
    padding: 5px 10px;
    background: #444;
}

.color-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 15px;
    align-content: flex-start;
}

/* Individual Inventory Item */
.inventory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.inventory-item .name {
    font-size: 10px;
    color: #ccc;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.inventory-item .color-bubble.selected {
    box-shadow: 0 0 0 3px #fff, 0 0 10px rgba(255,255,255,0.5);
    border: none;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(2); }
    100% { filter: brightness(1); }
}

.flash {
    animation: flash 0.5s ease;
}

/* Ideas Feature Styles */
.top-corner-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background-color: #FFC107;
    color: #1a1a1a;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    border: 2px solid #fff;
}

.bug-button {
    right: auto;
    left: 15px;
    background-color: #f44336; /* Red color */
}

.bug-button:hover {
    background-color: #d32f2f;
}

.top-corner-btn:hover {
    background-color: #FFD54F;
    transform: scale(1.05);
}

.bug-button:hover {
    background-color: #e53935;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--panel-color);
    width: 90%;
    max-width: 400px;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: translateY(0);
    transition: transform 0.2s;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px);
}

.modal-content h3 {
    margin: 0;
    color: #fff;
    text-align: center;
}

.modal-description {
    font-size: 0.9rem;
    color: #aaa;
    text-align: center;
    margin: 0;
}

.modal-content textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border-radius: 8px;
    background-color: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    font-family: inherit;
    resize: none;
    font-size: 14px;
}

.modal-content textarea:focus {
    outline: 2px solid var(--accent-color);
    border-color: transparent;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

#cancel-idea-btn {
    background-color: #444;
}

#submit-idea-btn {
    background-color: var(--accent-color);
}

@media (max-width: 480px) {
    :root {
        --slot-size: 55px;
        --bubble-size: 50px;
    }
    .sign {
        font-size: 20px;
    }
    .equation-container {
        gap: 5px;
    }
}