/* Custom styles for the follow the line game */
body, html {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #111;
    color: #eee;
    user-select: none;

    /* New flexbox properties */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Allow scrolling if content exceeds height */
}

.game-container {
    position: relative;
    flex-grow: 1;
    /* This makes the game container fill the available space */
    cursor: none;
}

#game-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#path {
    /* Visual path */
    stroke-width: 8px;
    stroke: #0d6efd;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

#path-hitbox {
    /* Invisible path for collision detection - REDUCED SIZE FOR HARDER PLAY */
    stroke-width: 45px;
    stroke: transparent;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

#player-cursor {
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Allows clicks to go through */
    transition: background-color 0.2s, box-shadow 0.2s;
    z-index: 20;
    /* Ensure cursor is on top */
}

#player-cursor.safe {
    background-color: rgba(13, 110, 253, 0.5);
    box-shadow: 0 0 15px #0d6efd;
}

#player-cursor.danger {
    background-color: rgba(220, 53, 69, 0.5);
    box-shadow: 0 0 15px #dc3545;
}

#ui-container {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Jura', sans-serif;
    z-index: 15;
    /* Ensure UI is on top of the game */
}

#score-display {
    font-size: 2.5rem;
}

#energy-bar-container {
    width: 40%;
    max-width: 300px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid #555;
    border-radius: 10px;
}

#energy-bar {
    height: 100%;
    width: 100%;
    background-color: #20c997;
    border-radius: 8px;
    transition: width 0.2s linear;
}

/* Start & Game Over Screen Styling */
.screen {
    /* This positions the screens relative to the .game-container */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
}

.screen-title {
    font-family: 'Jura', sans-serif;
    font-size: clamp(2rem, 8vw, 4rem);
}

.final-score-value {
    font-size: clamp(4rem, 12vw, 6rem);
    font-family: 'Jura', sans-serif;
    color: #0d6efd;
}

.legal-text {
    color: white !important;
}

.line-chasing-footer {
    background-color: #0d6efd78;
    z-index: 999;
}

.legal-text {
    color: #000000;
}