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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: white;
    padding: 10px;
}

#game-container {
    position: relative;
    background: #0a1929;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 15px;
    max-width: 500px;
    width: 100%;
}

#game-ui {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #4fc3f7;
    text-align: center;
    gap: 8px;
    flex-wrap: wrap;
}

#game-ui > div {
    flex: 1;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.pattern-button {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 4px solid transparent;
}

.pattern-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.pattern-button.active {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    border-color: white;
}

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

#start-screen, #game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 25, 41, 0.98);
    padding: 25px 30px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #1e88e5;
    box-shadow: 0 0 30px rgba(30, 136, 229, 0.5);
    z-index: 100;
    width: 90%;
    max-width: 500px;
}

#start-screen h1, #game-over h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #4fc3f7;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

#start-screen p {
    font-size: 14px;
    margin: 8px 0;
    color: #90caf9;
}

#final-score {
    font-size: 18px;
    margin-bottom: 15px;
    color: #4fc3f7;
}

button {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.4);
    margin-top: 15px;
    width: 100%;
    max-width: 250px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.6);
    background: linear-gradient(135deg, #2196f3 0%, #1e88e5 100%);
}

button:active {
    transform: translateY(0);
}

.hidden {
    display: none;
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(30, 136, 229, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.4);
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: rgba(30, 136, 229, 1);
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(30, 136, 229, 0.6);
}

@media (min-width: 640px) {
    #game-container {
        padding: 25px;
    }
    
    #game-ui {
        font-size: 16px;
        margin-bottom: 25px;
    }
    
    #game-board {
        gap: 20px;
        margin-bottom: 25px;
    }
    
    #start-screen, #game-over {
        padding: 35px 50px;
    }
    
    #start-screen h1, #game-over h2 {
        font-size: 38px;
    }
    
    #start-screen p {
        font-size: 16px;
    }
    
    #final-score {
        font-size: 22px;
    }
    
    button {
        padding: 15px 40px;
        font-size: 18px;
        width: auto;
    }
}

@media (min-width: 1024px) {
    #game-container {
        padding: 30px;
    }
    
    #game-ui {
        font-size: 18px;
        margin-bottom: 30px;
    }
    
    #game-board {
        gap: 20px;
        margin-bottom: 30px;
    }
    
    #start-screen, #game-over {
        padding: 40px 60px;
    }
    
    #start-screen h1, #game-over h2 {
        font-size: 48px;
    }
    
    #start-screen p {
        font-size: 16px;
    }
    
    #final-score {
        font-size: 24px;
    }
    
    button {
        padding: 15px 40px;
        font-size: 18px;
    }
}

@media (max-width: 640px) {
    #game-board {
        gap: 12px;
    }
    
    .back-button {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 14px;
    }
}

