* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: linear-gradient(135deg, #f0f0f0, #ffffff);
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    animation: subtleBg 10s ease-in-out infinite alternate;
}

@keyframes subtleBg {
    0% { background: linear-gradient(135deg, #f0f0f0, #ffffff); }
    100% { background: linear-gradient(135deg, #ffffff, #f0f0f0); }
}

#container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    margin: auto;
    position: relative;
}

#menu, #howtoSection, #game {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

#menu::before, #game::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0) 100%);
    opacity: 0.5;
    animation: pulseBg 5s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulseBg {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.05); opacity: 0.5; }
}

button {
    margin: 15px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-size: 18px;
    animation: buttonGlow 2s ease-in-out infinite alternate;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

@keyframes buttonGlow {
    0% { box-shadow: 0 4px 8px rgba(0,0,0,0.2); }
    100% { box-shadow: 0 6px 12px rgba(76,175,80,0.5); }
}

h1, h2 {
    color: #333;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: titleFade 1s ease-out;
}

@keyframes titleFade {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#topBar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 16px;
}

#canvas {
    width: 100%;
    height: calc(100% - 50px);
    background: white;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.power-up {
    animation: powerUpGlow 1s ease-in-out infinite alternate;
}

@keyframes powerUpGlow {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}