* {
    margin: 0;
    padding: 0;
    box-box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    color: #fff;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    max-height: 700px;
    background: #70c5ce;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.overlay {
    pointer-events: auto;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    padding: 2rem;
    border-radius: 24px;
    width: 80%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.3s ease-out;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    color: #f7d51d;
    text-shadow: 3px 3px 0 #000;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #ff4757;
    text-shadow: 2px 2px 0 #000;
}

p {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

button {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    box-shadow: 0 4px 0 #27ae60;
}

button:hover {
    background: #27ae60;
}

button:active {
    transform: translateY(4px);
    box-shadow: none;
}

#score-display {
    position: absolute;
    top: 2rem;
    font-size: 4rem;
    font-weight: 800;
    text-shadow: 3px 3px 0 #000;
    z-index: 10;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item span:first-child {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.stat-item span:last-child {
    font-size: 1.5rem;
    font-weight: 700;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
    #game-container {
        max-width: 100%;
        max-height: 100%;
    }
}