body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #222;
    font-family: 'Press Start 2P', cursive;
    color: #EAFAF1;
    /* Soft Mint / Neutral Bright */
    image-rendering: pixelated;
}

#game-container {
    position: relative;
    border: 4px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

canvas {
    border: 4px solid #333;
    background-color: #333;
    /* Dark Gray */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: block;
    /* Removes bottom space */
}

#ui-layer {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    /* Adjusted for larger pixel font */
    text-shadow: 2px 2px 0 #000;
}

#score {
    font-weight: normal;
    color: #F1C40F;
    font-size: 16px;
}

#stats {
    display: flex;
    gap: 20px;
    /* Space between Score and Goal */
}

#goal {
    font-weight: normal;
    color: #F1C40F;
    font-size: 16px;
    margin-top: 0;
    /* Remove top margin */
}

.blinking {
    animation: celebrate 0.5s ease-in-out infinite alternate;
    color: #FFD700 !important;
    /* Gold */
    text-shadow: 0 0 10px #FFD700;
}

@keyframes celebrate {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.2);
    }
}

/* Help / Controls Icon */
#help-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: auto;
    /* Allow hovering */
}

#help-icon {
    width: 24px;
    height: 24px;
    border: 2px solid #BDC3C7;
    border-radius: 0;
    /* Square for pixel look */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    line-height: 1;
    /* Reset line height for better vertical centering */
    color: #BDC3C7;
    cursor: help;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.2s;
    box-shadow: 2px 2px 0 #000;
    /* Pixel shadow depth */
}

#help-container:hover #help-icon {
    color: #fff;
    border-color: #fff;
    background-color: rgba(0, 0, 0, 0.8);
}

#controls-hint {
    color: #BDC3C7;
    font-size: 10px;
    text-align: right;
    line-height: 1.8;
    display: flex;
    flex-direction: column;

    /* Hide by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;

    /* Position tooltip */
    position: absolute;
    top: 35px;
    /* Below the icon */
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border: 1px solid #BDC3C7;
    white-space: nowrap;
    /* Keep lines from wrapping */
}

/* Show on hover */
#help-container:hover #controls-hint {
    opacity: 1;
    visibility: visible;
}

#controls-hint p {
    margin: 0;
    letter-spacing: 1px;
    /* Better readability for wide font */
}

/* Start Menu Styling */
#start-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: auto;
    padding: 40px;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: #EAFAF1;
    font-family: 'Press Start 2P', cursive;
    border: 4px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

#start-menu h1 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #2ECC71;
    text-shadow: 2px 2px 0 #000;
    text-align: center;
    line-height: 1.5;
}

.menu-controls {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    text-shadow: 2px 2px 0 #000;
}

#playerColor {
    cursor: pointer;
    border: 4px solid #fff;
    width: 48px;
    height: 48px;
    background: none;
    padding: 0;
    box-shadow: 4px 4px 0 #000;
}

#startBtn {
    padding: 15px 30px;
    font-size: 14px;
    font-family: 'Press Start 2P', cursive;
    background: #2ECC71;
    color: #fff;
    border: 4px solid #fff;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    transition: transform 0.1s, box-shadow 0.1s;
    text-shadow: 2px 2px 0 #000;
}

#startBtn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
    background: #27AE60;
}

#startBtn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.hidden {
    display: none !important;
}