:root {
    --color-bg-deep: #1a1b41;
    --color-pastel-pink: #ffd1dc;
    --color-pastel-blue: #a2d2ff;
    --color-pastel-mint: #b9fbc0;
    --color-pastel-yellow: #fcf4dd;
    --color-text: #fff;
    --color-cat-orange: #ff9f1c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0b0c10;
    font-family: 'Fredoka', sans-serif;
    touch-action: none; /* Prevent scrolling on mobile */
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px; /* Limit width for desktop */
    margin: 0 auto;
    background: linear-gradient(to bottom, #111424, #1a1b41);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    overflow: hidden;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#bg-canvas {
    z-index: 1;
}

#game-canvas {
    z-index: 2;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none; /* Let touches pass through to canvas/touch overlay */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
}

#top-bar {
    display: flex;
    justify-content: space-between;
    color: var(--color-pastel-yellow);
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

#bottom-bar {
    display: flex;
    justify-content: flex-start;
}

#lives-display {
    display: flex;
    gap: 5px;
}

.heart {
    width: 20px;
    height: 20px;
    background-color: var(--color-pastel-pink);
    clip-path: polygon(50% 100%, 0% 50%, 0% 0%, 50% 30%, 100% 0%, 100% 50%);
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: rgba(26, 27, 65, 0.85);
    backdrop-filter: blur(5px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.screen.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.title {
    color: var(--color-pastel-mint);
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 var(--color-bg-deep), -1px -1px 0 var(--color-bg-deep), 1px -1px 0 var(--color-bg-deep), -1px 1px 0 var(--color-bg-deep), 1px 1px 0 var(--color-bg-deep);
}

.subtitle {
    font-size: 2rem;
    color: var(--color-cat-orange);
}

.description, .final-score, .controls-desc {
    color: var(--color-text);
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.controls-desc {
    font-size: 0.9rem;
    color: var(--color-pastel-blue);
    opacity: 0.8;
}

.btn {
    background-color: var(--color-pastel-pink);
    color: #333;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 0 #d1a1b3;
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #d1a1b3;
}

#touch-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Between UI and Screens */
    display: none; /* Enabled via JS on mobile */
}
