body {
    margin: 0;
    background: #1e3c72; /* Темно-синий фон страницы */
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    overflow: hidden; /* Убираем скролл */
    user-select: none;
}

button {
    padding: 15px 40px;
    font-size: 20px;
    margin: 10px;
    cursor: pointer;
    background: #ff9800;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    transition: transform 0.1s;
}

button:active {
    transform: scale(0.95);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.exit-btn {
    position: absolute;
    right: 20px;
    top: 10px;
    padding: 8px 15px;
    font-size: 14px;
    background: #d32f2f;
}

#menu {
    margin-top: 15vh;
}

#gameUI {
    display: none;
    position: relative;
    width: min(900px, calc(100vw - 20px), calc((100vh - 30px) * 1.8));
    margin: 10px auto;
}

#hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    font-weight: bold;
    z-index: 10;
    text-shadow: 2px 2px 4px black;
}

#centerScore {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(36px, 9vw, 80px);
    font-weight: 900;
    opacity: 0.2;
    pointer-events: none;
    color: white;
}

canvas {
    width: 100%;          /* поле масштабируется под окно, пропорции 900×500 сохраняются */
    height: auto;
    box-sizing: border-box;
    background: linear-gradient(#87CEEB, #E0F7FA); /* Небо */
    border: 5px solid #fff;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    display: block;
}

/* Экран конца игры */
#endScreen {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid white;
    z-index: 100;
}
#menu h1 { font-size: clamp(28px, 6vw, 48px); }
.controls-hint { opacity: 0.8; font-size: 15px; margin-top: 18px; line-height: 1.6; }
