body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at center, #fff4e6 0%, #ffd8a8 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none; /* Prevents mobile browser scrolling/bouncing */
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa), 
        linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    opacity: 0.3;
    z-index: -1;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#uiLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: bold;
    color: #8b5a2b;
    text-shadow: 2px 2px 0px rgba(255,255,255,0.8);
    z-index: 5;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 10;
}

.overlay h1 {
    font-size: 56px;
    margin: 0 0 15px 0;
    color: #f5b041;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    text-align: center;
}

.overlay p {
    font-size: 24px;
    margin: 0 0 40px 0;
}

.btn {
    padding: 15px 40px;
    font-size: 24px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    transition: transform 0.1s;
    pointer-events: auto;
    font-weight: bold;
}

.btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

@media (max-width: 600px) {
    #uiLayer {
        font-size: 18px;
        padding: 15px;
    }
    .overlay h1 {
        font-size: 42px;
    }
}
