body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 20px;
    color: #333;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}

.header-bg {
    width: 100%;
    height: 100px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

h1 {
    font-size: 2.5em;
    margin: 0;
    /* Removed white color as it might clash with gradient */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center; /* Ensure heading is centered */
}

p {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

button {
    display: inline-flex; /* Changed from flex to inline-flex for better centering */
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 1em;
    background: #fff;
    border: none;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s; /* Added color transition */
    margin: 5px; /* Added margin for spacing when wrapping */
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: #fff;
}

button .icon {
    vertical-align: middle;
}

#bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-width: 600px;
    margin: 20px auto; /* Ensure margin top/bottom */
}

.cell {
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    transition: transform 0.2s, background 0.2s, color 0.2s; /* Added color transition */
    cursor: pointer;
    border: 1px solid #ddd; /* Added subtle border */
    word-break: break-word; /* Prevent long words overflowing */
}

.cell:hover {
    transform: scale(1.05);
}

.free {
    background: linear-gradient(45deg, #ffd700, #ffec80);
    font-weight: bold;
    border-color: #e0c000; /* Darker border for free space */
}

.marked {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    color: #fff;
    transform: scale(1.02);
    border-color: #3aa99f; /* Darker border for marked cells */
}

#selection-panel {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#selection-panel h2 {
    margin-top: 0;
    color: #ff6b6b;
    text-align: center; /* Center selection panel heading */
}

#selection-list {
    list-style-type: none;
    padding: 0;
}

#selection-list li {
    margin: 8px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.9em;
    color: #777;
}

footer a {
    color: #4ecdc4;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Ensure buttons are centered */
body > button {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
