body {
    margin: 0; padding: 0;
    background: #010006;
    display: flex; justify-content: center; align-items: center;
    height: 100vh;
    font-family: 'Space Mono', 'Noto Sans TC', sans-serif;
    color: white; user-select: none; overflow: hidden;
}

#game-wrapper {
    position: relative;
    width: 600px; height: 600px;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.2);
    border-radius: 12px;
    background: #000;
}

@media (max-width: 650px) {
    #game-wrapper { width: 100vw; height: 100vw; box-shadow: none; border-radius: 0; }
    canvas { width: 100vw !important; height: 100vw !important; }
}

#ui-layer {
    position: absolute; top: -50px; left: 0; width: 100%;
    display: flex; justify-content: space-between;
    font-size: 24px; font-weight: bold; color: #0f0; text-shadow: 0 0 10px #0f0;
    pointer-events: none; z-index: 10;
}

@media (max-width: 650px) {
    #ui-layer { top: 20px; padding: 0 20px; box-sizing: border-box; }
}

canvas { display: block; touch-action: none; border-radius: 12px;}

.overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); z-index: 20; text-align: center;
    border-radius: 12px;
}
@media (max-width: 650px) { .overlay { border-radius: 0; } }

h1 { font-family: 'Noto Sans TC'; font-size: 48px; margin: 0 0 15px; text-shadow: 0 0 25px #0f0; letter-spacing: 4px; color:#0f0;}
h1.over { text-shadow: 0 0 30px #f00; color: #ff3333; }
p { font-size: 16px; color: #ccc; margin-bottom: 30px; line-height: 1.8; }

.btn {
    padding: 12px 40px; font-size: 22px; font-family: 'Noto Sans TC'; font-weight: 900;
    color: #111; background: #0f0; border: none; border-radius: 5px; cursor: pointer;
    box-shadow: 0 0 20px rgba(0,255,0,0.6); transition: transform 0.2s; margin-bottom: 25px;
}
.btn:hover { background: #fff; transform: scale(1.05); }
.btn:active { transform: scale(0.95); }

#gameOverOverlay .btn { background: #ff3333; color: #fff; box-shadow: 0 0 20px #f00; }

.back-btn {
    position: absolute; bottom: 25px; color: #668; text-decoration: none; border-bottom: 1px solid #668;
    transition: color 0.2s;
}
.back-btn:hover { color: #0f0; border-color: #0f0; }
