* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    touch-action: none;
}

#gameContainer {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
    max-width: 600px;
    width: 100%;
}

#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

#levelInfo {
    font-size: 24px;
    font-weight: bold;
    color: #2C3E50;
}

#controls {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #E8EAF6;
    color: #3F51B5;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: #C5CAE9;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #3F51B5;
    color: white;
    font-size: 16px;
    padding: 12px 24px;
}

.btn-primary:hover {
    background: #303F9F;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    border-radius: 12px;
    background: #F5F5F5;
    cursor: crosshair;
    touch-action: none;
}

#winScreen, #tutorial {
    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: 1000;
}

#winContent, #tutorialContent {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    animation: slideUp 0.3s ease-out;
}

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

#winContent h2 {
    color: #2C3E50;
    margin-bottom: 20px;
}

#stars {
    font-size: 32px;
    margin: 20px 0;
}

#moveCount {
    color: #7F8C8D;
    margin-bottom: 20px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

#tutorialContent h3 {
    color: #2C3E50;
    margin-bottom: 20px;
}

#tutorialContent p {
    color: #7F8C8D;
    margin: 12px 0;
    line-height: 1.6;
}

@media (max-width: 600px) {
    #gameContainer {
        padding: 15px;
    }
    
    #header {
        font-size: 18px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    #winContent, #tutorialContent {
        padding: 30px 20px;
        margin: 0 20px;
    }
}
