@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&display=swap');

html,
body {
    height: 100%;
    margin: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
}

.game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Remove borderRadius/shadow for full immersion */
    border-radius: 0;
    box-shadow: none;
    line-height: 0;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    touch-action: none;
    /* Prevent zoom/scroll on mobile */
    cursor: pointer;
}

.ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Space out items (score top, button bottom) */
    align-items: center;
    padding: 20px 0 30px 0;
    /* Add padding for spacing */
    box-sizing: border-box;
}

.score-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.score-pill {
    /* Just background blur/outline as requested */
    background: rgba(255, 255, 255, 0.05);
    /* Very faint bg */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 25px 60px;
    /* Taller (25px), Less Wide (60px) */
    border-radius: 60px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    /* Clearer outline */
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);

    /* Perfect Centering */
    display: flex;
    justify-content: center;
    gap: 15px;
    pointer-events: none;
    z-index: 10;
    align-items: center;
    min-width: 80px;
    margin-top: 0;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    /* Pill shape */
    padding: 10px 30px;
    width: auto;
    /* Fit text */
    height: auto;
    font-size: 18px;
    /* Slightly smaller for text */
    font-weight: 700;
    font-family: inherit;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: transform 0.1s, background 0.2s;
    pointer-events: auto;
    display: inline-block;
}

.action-btn:active {
    transform: scale(0.9);
}

.hidden {
    display: none !important;
}

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
    opacity: 1;
    transition: opacity 0.2s;
    pointer-events: auto;
    /* Catch clicks */
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
    /* simple hide */
}

.modal-content {
    background: linear-gradient(135deg, #2b1055, #7597de);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 80%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Spacing between all elements */
}

.modal-content h2 {
    margin: 0 0 20px;
    font-size: 24px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#leaderboardList {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
}

#leaderboardList li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 18px;
    font-weight: 700;
}

#leaderboardList li:last-child {
    border-bottom: none;
}

.modal-content button {
    background: #ff4081;
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 64, 129, 0.4);
}

.modal-content input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 18px;
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.high-score-pill {
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.2);
    min-height: auto;
    gap: 8px;
}

.high-score-pill .label {
    color: #ffd700;
    font-size: 14px;
    letter-spacing: 1px;
}

.controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 50;
    /* Ensure active modals are on top */
}

/* Button styles removed */

/* Hide scrollbars */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}