body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f0f0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #333;
}

.controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.game-select, .board-size-select {
    padding: 8px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

button {
    padding: 8px 16px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.bingo-board {
    display: grid;
    grid-template-columns: repeat(var(--board-size, 5), 1fr);
    gap: 10px;
    max-width: min(90vw, 600px);
    margin: 0 auto;
}

.bingo-cell {
    aspect-ratio: 1;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(5px, 1vw, 10px);
    font-size: clamp(0.6rem, calc(90vw / var(--board-size, 5) / 8), 1rem);
    cursor: pointer;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow: hidden;
    line-height: 1.2;
}

.bingo-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.share-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

#boardLink {
    padding: 8px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 300px;
    background-color: #fff;
}

#copyLink {
    background-color: #2196F3;
}

#copyLink:hover {
    background-color: #1976D2;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.player-status {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker label {
    font-size: 14px;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.statistics {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.statistics h2 {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.player-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.player-stat-card {
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 6px;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.player-stat-card .player-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.player-stat-card .field-count {
    font-size: 20px;
    color: #2196F3;
}

.player-stat-card .field-label {
    font-size: 0.8em;
    color: #666;
}

@media (max-width: 768px) {
    .bingo-board {
        gap: 5px;
        max-width: 95vw;
    }

    .bingo-cell {
        font-size: clamp(0.5rem, calc(90vw / var(--board-size, 5) / 10), 0.9rem);
        padding: clamp(3px, 0.5vw, 8px);
        border-radius: 4px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    #boardLink {
        width: 100%;
    }

    .player-stat-card {
        min-width: 80px;
    }
}
