/* Color Sort Game Styles */
.color-sort-game {
    font-family: 'Raleway', sans-serif !important;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    min-height: calc(100vh - 56px) !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    overflow-x: hidden !important;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    margin: 0;
    letter-spacing: 2px;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.game-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.game-button.primary {
    background: linear-gradient(45deg, #00d4ff, #00a8cc);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.game-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.game-button.compact {
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* Score Display */
.score-time {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 15px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Game Area */
.game-area {
    position: relative;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.instructions {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

/* Canvas */
#gameCanvas {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#gameCanvas:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Drop Zones */
.drop-zones {
    margin-bottom: 30px;
}

.drop-zone {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 60px;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
}

.drop-zone.drag-over {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.drop-zone.magnetic {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    transform: scale(1.02);
}

.drop-zone.completed {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
    animation: completeGlow 1.5s ease-out;
}

.drop-zone-label {
    position: absolute;
    left: 15px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Circles */
.circles-container {
    position: relative;
    min-height: 200px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
}

.circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: absolute;
    cursor: grab;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.circle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.circle.dragging {
    cursor: grabbing;
    transform: scale(1.2);
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.circle.in-zone {
    position: relative;
    margin: 5px;
    cursor: grab;
}

/* Color Classes */
.circle.red { background: #ff4757; }
.circle.blue { background: #3742fa; }
.circle.green { background: #2ed573; }
.circle.yellow { background: #ffa502; }
.circle.purple { background: #a55eea; }
.circle.orange { background: #ff6348; }
.circle.pink { background: #ff3838; }
.circle.cyan { background: #00d4ff; }

/* Level Complete Overlay */
.level-complete {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.level-complete-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.level-complete-content h2 {
    color: #00d4ff;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.level-stats {
    margin: 20px 0;
    color: white;
    font-size: 1.2rem;
}

.level-stats div {
    margin: 10px 0;
}

/* Animations */
@keyframes completeGlow {
    0% { 
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
        transform: scale(1);
    }
    25% { 
        box-shadow: 0 0 50px rgba(76, 175, 80, 0.8);
        transform: scale(1.05);
    }
    50% { 
        box-shadow: 0 0 60px rgba(76, 175, 80, 1);
        transform: scale(1.08);
    }
    75% { 
        box-shadow: 0 0 40px rgba(76, 175, 80, 0.6);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.circle {
    animation: slideIn 0.5s ease-out;
}

.circle.dragging {
    animation: pulse 0.3s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .score-time {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .stat-card {
        width: 200px;
    }
    
    .header-top {
        flex-direction: column;
        gap: 15px;
    }
    
    .circle {
        width: 35px;
        height: 35px;
    }
}