body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', cursive;
    background-color: #DEB887; /* BurlyWood - a light, warm brown */
    color: #5D4037; /* Dark Brown */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align items to the start for better layout with scrolling */
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

h1 {
    color: #8B4513; /* SaddleBrown */
    margin-top: 20px;
    margin-bottom: 40px;
    font-size: clamp(2.5em, 5vw, 4em); /* Responsive font size */
    text-shadow: 3px 3px #A0522D; /* Sienna */
    letter-spacing: 2px;
}

#soundboard-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 900px; /* Max width for the grid */
    padding: 10px;
}

button {
    background-color: #CD853F; /* Peru */
    border: none;
    color: #FFFFFF; /* White text for better contrast */
    padding: 0;
    font-size: clamp(1em, 2.5vw, 1.3em); /* Responsive font size */
    font-weight: bold;
    border-radius: 18px; /* More rounded buttons */
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    overflow: hidden;
    position: relative;
    min-height: 140px; /* Taller buttons to accommodate play count */
}

.sound-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding: 15px 10px;
    background: linear-gradient(145deg, #D2691E, #CD853F);
    border-radius: 18px;
    border: 4px solid #8B4513; /* SaddleBrown */
    box-sizing: border-box;
    text-align: center;
}

.sound-emoji {
    font-size: 2.2em;
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.sound-name {
    font-size: 1.1em;
    line-height: 1.2;
    margin-bottom: 10px;
    font-weight: bold;
}

.play-count {
    font-size: 0.8em;
    background-color: rgba(139, 69, 19, 0.7); /* Semi-transparent SaddleBrown */
    padding: 3px 8px;
    border-radius: 12px;
    color: #FFF8DC; /* Cornsilk - slightly off-white */
    font-weight: normal;
}

button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.25);
}

button:hover .sound-card-content {
    background: linear-gradient(145deg, #E67E22, #D2691E);
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

button:active .sound-card-content {
    background: linear-gradient(145deg, #A0522D, #CD853F);
}

/* Audio Notice Styling */
#audio-notice {
    background-color: rgba(210, 105, 30, 0.2);
    padding: 8px 16px;
    border-radius: 10px;
    margin-top: -20px;
    margin-bottom: 20px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* For smaller screens, adjust grid columns */
@media (max-width: 480px) {
    #soundboard-container {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }
    
    button {
        min-height: 130px;
    }
    
    .sound-emoji {
        font-size: 1.8em;
        margin-bottom: 8px;
    }
    
    .sound-name {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .play-count {
        font-size: 0.75em;
        padding: 2px 6px;
    }
    
    h1 {
        font-size: clamp(2em, 4vw, 3em);
        margin-bottom: 30px;
    }
}