/* styles.css */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px; /* Add padding for spacing */
    box-sizing: border-box;
    min-height: 100vh;
    display: flex; /* Use flexbox for centering wrapper */
    justify-content: center;
    align-items: flex-start; /* Align items to the top */
}

#app-wrapper {
    display: flex;
    justify-content: center; /* Center items horizontally */
    align-items: flex-start; /* Align items to the top */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 30px; /* Add space between the two main sections */
    width: 100%;
    max-width: 1000px; /* Adjust max-width as needed */
}

.lottery-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    flex: 2; /* Make lottery container take more space */
    min-width: 300px; /* Minimum width */
    max-width: 550px; /* Optional: Limit max width */
}

h1, h2 {
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: bold;
    text-align: left;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    margin-bottom: 20px;
    resize: vertical;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 20px; /* Add margin below button */
}

button:hover {
    background-color: #0056b3;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#rollingArea {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa; /* Slightly different background */
    border: 1px solid #dee2e6;
    border-radius: 5px;
    min-height: 60px; /* Ensure sufficient height */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background-color 0.3s ease;
    font-size: 1.4em; /* Make rolling names larger */
    color: #6c757d; /* Dimmer color for rolling names */
}

.instructions {
    margin-top: 10px;
    color: #dc3545; /* Red color for instruction */
    font-weight: bold;
    font-size: 0.9em;
    min-height: 1.2em; /* Prevent layout shift when shown/hidden */
}


#winner-display-area {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex: 1; /* Make winner area take less space */
    min-width: 250px; /* Minimum width */
    max-width: 350px; /* Optional: Limit max width */
    align-self: stretch; /* Make it same height as controls (if flex-start is used) */
    display: flex;
    flex-direction: column; /* Stack heading and result vertically */
}

#winnerResult {
    margin-top: 15px;
    padding: 20px;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 5px;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center; /* Center text inside */
    flex-grow: 1; /* Allow it to grow */
}

#winnerResult p {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

#winnerResult .winner-name {
    color: #d9534f;
    font-weight: bold;
    font-size: 1.7em; /* Make final winner name very prominent */
    display: inline-block;
    animation: winnerPop 0.5s ease-out;
}

/* Animation for the final winner */
@keyframes winnerPop {
    0% { transform: scale(0.8); opacity: 0.5; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #app-wrapper {
        flex-direction: column; /* Stack vertically */
        align-items: center; /* Center items when stacked */
    }
    .lottery-container, #winner-display-area {
        flex: none; /* Reset flex property */
        width: 95%; /* Take most of the width */
        max-width: 550px; /* Consistent max width */
    }
    #winner-display-area {
        margin-top: 20px; /* Add space when stacked */
    }
}