body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    height: 100vh;
}

.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.difficulty-selector {
    display: flex;
    gap: 8px;
}

.difficulty-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.difficulty-btn.active {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.difficulty-btn:hover {
    background: rgba(255,255,255,0.25);
}

.timer-display {
    font-size: 18px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #6366f1;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(99,102,241,0.6);
}

.control-panel {
    position: fixed;
    right: 0;
    top: 60px;
    width: 30%;
    height: calc(100vh - 60px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.number-pad button {
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.number-pad button:hover {
    background: #f8f9ff;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99,102,241,0.2);
}

.number-pad button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.utility-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.utility-buttons button {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-weight: 500;
}

.utility-buttons button:hover {
    background: #f8f9ff;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99,102,241,0.2);
}

.utility-buttons button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.celebration-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease;
}

.celebration-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.celebration-content h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 28px;
}

.completion-time {
    font-size: 24px;
    color: #6366f1;
    font-weight: bold;
    margin: 10px 0;
}

.difficulty-label {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

.celebration-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
    font-size: 14px;
    color: #888;
}

.next-puzzle-text {
    color: #999;
    font-style: italic;
    margin-top: 20px;
}

.achievement-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #4ade80;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(74,222,128,0.4);
    z-index: 1500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-weight: 500;
}

.achievement-toast.show {
    transform: translateX(0);
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: confettiFall 3s linear;
    z-index: 1999;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .game-header {
        padding: 0 15px;
        height: 50px;
    }
    
    .difficulty-selector {
        gap: 6px;
    }
    
    .difficulty-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .timer-display {
        font-size: 16px;
    }
    
    .control-panel {
        position: fixed;
        bottom: 0;
        right: 0;
        top: 50px;
        width: 100%;
        height: 40%;
        border-radius: 20px 20px 0 0;
    }
    
    .number-pad {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .number-pad button {
        padding: 12px 8px;
        font-size: 16px;
    }
    
    .utility-buttons {
        flex-direction: row;
    }
    
    .utility-buttons button {
        flex: 1;
        padding: 10px;
        font-size: 14px;
    }
    
    .fab {
        bottom: 45%;
        right: 15px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .celebration-content {
        margin: 20px;
        padding: 30px;
    }
    
    .celebration-icon {
        font-size: 48px;
    }
    
    .celebration-content h2 {
        font-size: 24px;
    }
    
    .completion-time {
        font-size: 20px;
    }
    
    .celebration-stats {
        flex-direction: column;
        gap: 10px;
    }
}
