:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --accent-color: #bb86fc;
    --secondary-bg: #1e1e1e;
    --block-height: 120px;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    text-align: center;
}

header {
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: rainbow 10s ease infinite;
}

/* Menu Screen */
.screen {
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
    opacity: 0;
}

.difficulty-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.btn-diff {
    background: var(--secondary-bg);
    border: 1px solid #333;
    padding: 20px;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn-diff:hover {
    transform: translateY(-5px);
    background: #2a2a2a;
    border-color: var(--accent-color);
}

.btn-diff .desc {
    font-size: 0.8rem;
    color: #888;
    display: block;
    margin-top: 5px;
}

/* Game Screen */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: white;
}

.game-area-wrapper {
    background: #000;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 30px;
}

.game-board {
    display: flex;
    height: var(--block-height);
    width: 100%;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden; /* Important for corner radius */
}

.color-block {
    height: 100%;
    flex: 1;
    cursor: grab;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-block.fixed {
    cursor: default;
}

.color-block.fixed::after {
    content: '•';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(0,0,0,0.3);
    font-size: 20px;
}

.color-block.dragging {
    opacity: 0.5;
    z-index: 10;
    transform: scale(0.95);
}

.color-block:hover:not(.fixed) {
    z-index: 2;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.action-btn {
    background: var(--accent-color);
    color: black;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, filter 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--secondary-bg);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid #333;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: bold;
}

#next-level-btn {
    background: var(--accent-color);
    color: #000;
}

#modal-menu-btn {
    background: transparent;
    border: 1px solid #555;
    color: #fff;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@media (max-width: 600px) {
    .game-board {
        flex-direction: column;
        height: auto;
    }
    
    .color-block {
        height: 50px;
        width: 100%;
    }
}
