@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&family=Pacifico&display=swap');

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    background: #333;
    /* Fallback */
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    /* Mobile width cap */
    height: 100%;
    max-height: 800px;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
}

canvas {
    background: url('http://s2js.com/img/etc/flappyback.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    border-radius: 12px;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* UI Overlay Layer */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to canvas when playing */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    pointer-events: auto;
    /* Enable buttons */
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

h1 {
    font-family: 'Pacifico', cursive;
    font-size: 3.5rem;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 0px #000;
    color: #ffeb3b;
}

p {
    font-size: 1.5rem;
    margin: 10px 0;
}

button {
    background: #ff5722;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
    transition: transform 0.1s, background 0.2s;
}

button:active {
    transform: scale(0.95);
    background: #f4511e;
}

#score-display {
    position: absolute;
    top: 40px;
    font-size: 4rem;
    font-family: 'Pacifico', cursive;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 10;
}