body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Aligns content to the top */
    padding: 50px 20px;
    margin: 0;
}

.container {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); /* Deeper shadow for better look */
    max-width: 750px; /* Wider container for the new layout */
    width: 100%;
    text-align: center;
}

h1 {
    color: #004d99; /* Deep Blue */
    margin-bottom: 5px;
}

.controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 25px 0;
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    gap: 10px;
}

#lottoGame, #generateBtn, #gameCount {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 16px;
    /* Flex grow allows controls to take up space nicely */
    flex-grow: 1; 
}

#lottoGame {
    border: 1px solid #ccc;
    cursor: pointer;
}

.count-label {
    white-space: nowrap; /* Prevents "Games:" from wrapping */
    font-weight: bold;
    color: #555;
    flex-grow: 0;
}

#gameCount {
    width: 60px; /* Narrower for the number input */
    text-align: center;
    border: 1px solid #ccc;
    flex-grow: 0;
}

#generateBtn {
    background-color: #00b33c; /* Bright Green */
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#generateBtn:hover {
    background-color: #008f30; 
}

.results-area {
    min-height: 50px;
    margin-top: 30px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* Container for one single game result (the ticket line) */
.game-line {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Label for each game (e.g., "Game 1:") */
.game-line-label {
    font-weight: bold;
    color: #004d99;
    margin-right: 10px;
    min-width: 65px; 
    font-size: 1.1em;
}

/* Styling for the Lottery Balls */
.ball {
    width: 45px;
    height: 45px;
    line-height: 45px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Clearer shadow */
    display: inline-block;
    transition: transform 0.1s;
}

/* Specific Ball Colors */
.ball.main-ball { background-color: #004d99; } /* Main Blue */
.ball.power-ball { background-color: #ff3333; } /* Powerball Red */

/* Separator for Powerball */
.separator {
    font-size: 30px;
    font-weight: 300;
    line-height: 45px;
    margin: 0 5px;
    color: #666;
}
@media (max-width: 600px) {
    /* 1. Stack the input fields and buttons vertically */
    .controls {
        flex-direction: column; 
        align-items: stretch;
    }
    
    /* 2. Style the labels to look better when stacked */
    .controls label {
        align-self: flex-start; 
        margin-top: 10px;
    }
    
    /* 3. Make the game count input wider */
    #gameCount {
        width: 100%;
        margin-bottom: 15px;
    }

    /* 4. Make the lottery balls slightly smaller for tight spacing */
    .ball {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 16px;
    }
    
    /* 5. Reduce padding and font size for a cleaner look */
    .container {
        padding: 15px 10px;
        box-shadow: none; 
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    .game-line-label {
        min-width: 55px;
    }
}
