body {
    margin: 0;
    font-family: sans-serif;
    background-color: #3e2723;
    overflow: hidden;
    color: white;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background-image: url('images/fond-potager.png');
    background-size: cover;
    background-position: center bottom;
}

#ui-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.5em;
    z-index: 100;
}

#timer-display {
    display: flex;
    align-items: center;
}

#timer-display img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

#game-board {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    gap: 20px;
    z-index: 10;
}

.hole {
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url('images/trou.png');
}

.hole:hover {
    transform: scale(1.1);
}

.hole.dug {
    background-image: url('images/trou-fouille.png');
    cursor: default;
    transform: scale(1);
}

#fox {
    position: absolute;
    width: 80px;
    height: 80px;
    transition: all 0.3s ease-in-out;
    z-index: 50;
    pointer-events: none;
}

#fox img {
    width: 100%;
    height: 100%;
}

.item-popup {
    position: absolute;
    width: 80px;
    height: 80px;
    z-index: 200;
    pointer-events: none;
    animation: item-flash 1s forwards;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.item-popup img {
    width: 60px;
    height: 60px;
}

.item-popup .feedback {
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px black;
}
.item-popup .feedback.positive { color: #8bc34a; }
.item-popup .feedback.negative { color: #f44336; }


@keyframes item-flash {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -100%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -120%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(0.5); opacity: 0; }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.overlay.visible {
    visibility: visible;
    opacity: 1;
}

.overlay-content {
    text-align: center;
    background: #5d4037;
    padding: 40px;
    border-radius: 20px;
    border: 5px solid #a1887f;
}

.overlay-content h1 {
    font-size: 3em;
    margin-bottom: 20px;
}
.overlay-content h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.overlay-content button {
    font-size: 1.5em;
    padding: 15px 30px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background-color: #f57c00;
    color: white;
}
