body {
    background: url('../img/foot/background-foot.jpeg') no-repeat #fff;
    background-size: cover;
}

.foot-container {
    background: linear-gradient(180deg, #eef9f1 0%, #eef9f1 55%, #cdebd5 100%);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

#foot-instructions {
    margin: 0 0 0.75rem;
}

/* ── Pitch ── */
.foot-field {
    position: relative;
    width: 320px;
    height: 300px;
    margin: 0 auto;
    background: linear-gradient(180deg, #4caf50 0%, #3d9142 100%);
    border-radius: 8px;
    overflow: hidden;
}

/* ── Sponsor board: floating panel, logo repeated across the width ── */
.foot-sponsor-board {
    position: absolute;
    top: 10px;
    left: 6px;
    right: 6px;
    height: 30px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 4px;
    padding: 2px 8px;
    background: #fff;
    border: 2px solid #ddb35a;
    border-radius: 6px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1;
}

.foot-sponsor-board img {
    height: 100%;
    max-width: 18%;
    object-fit: contain;
    flex: 0 1 auto;
}

/* ── Goal ── */
.foot-goal {
    position: absolute;
    top: 50px;
    left: 50%;
    width: 240px;
    height: 120px;
    margin-left: -120px;
    box-sizing: border-box;
    border: 6px solid #fff;
    border-bottom: none;
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0.5) 1px, transparent 1px, transparent 14px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0.5) 1px, transparent 1px, transparent 14px);
}

/* ── Goalkeeper ── */
.foot-goalkeeper {
    position: absolute;
    bottom: 6px;
    left: 50%;
    width: 34px;
    height: 64px;
    margin-left: -17px;
    transition: transform 0.5s cubic-bezier(.34, 1.56, .64, 1);
}

.foot-goalkeeper::before {
    /* head */
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f2c089;
}

.foot-goalkeeper::after {
    /* jersey */
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    margin-left: -13px;
    width: 26px;
    height: 40px;
    border-radius: 8px 8px 4px 4px;
    background: var(--gaming-primary, #222);
}

/* Dives to either post: when the keeper picks the same side as the
   shot, he ends up covering the ball ("dessus"); a different side
   means the ball goes in unguarded. Side dives travel much further
   than the center one, so they get a slower transition to avoid
   looking too snappy. */
.foot-goalkeeper.dive-left,
.foot-goalkeeper.dive-right {
    transition: transform 0.75s cubic-bezier(.34, 1.56, .64, 1);
}

.foot-goalkeeper.dive-left {
    transform: translate(-94px, -6px) rotate(-60deg);
}

.foot-goalkeeper.dive-right {
    transform: translate(94px, -6px) rotate(60deg);
}

.foot-goalkeeper.dive-center {
    transform: translateY(-4px) scale(1.08);
}

/* ── Ball (classic black & white pattern) ── */
.foot-ball {
    position: absolute;
    left: 50%;
    top: 258px;
    width: 26px;
    height: 26px;
    margin-left: -13px;
    border-radius: 50%;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 62%, #1a1a1a 0 28%, transparent 29%),
        radial-gradient(circle at 86% 62%, #1a1a1a 0 28%, transparent 29%),
        #fff;
    box-shadow: inset 0 0 0 1px #999, 0 2px 3px rgba(0, 0, 0, 0.3);
    /* straight, slow, constant-speed travel toward the chosen corner */
    transition: top 1.1s linear, left 1.1s linear;
}

.foot-ball::before,
.foot-ball::after {
    content: '';
    position: absolute;
    background: #1a1a1a;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.foot-ball::before {
    /* central pentagon */
    top: 18%;
    left: 50%;
    width: 46%;
    height: 42%;
    margin-left: -23%;
}

.foot-ball::after {
    /* lower pentagon, partly cropped by the ball's edge */
    bottom: -14%;
    left: 50%;
    width: 40%;
    height: 36%;
    margin-left: -20%;
}

/* The ball always ends up inside the goal, whatever the outcome —
   only the goalkeeper's side decides if it's a goal or a save. */
.foot-ball.kick-left {
    top: 90px;
    left: 70px;
}

.foot-ball.kick-center {
    top: 90px;
    left: 50%;
}

.foot-ball.kick-right {
    top: 90px;
    left: 250px;
}

/* ── Side buttons ── */
#foot-sides {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 1rem;
}

.foot-side-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .foot-field {
        width: 260px;
        height: 250px;
    }

    .foot-sponsor-board {
        height: 24px;
        padding: 2px 6px;
    }

    .foot-goal {
        width: 190px;
        height: 100px;
        margin-left: -95px;
    }

    .foot-goalkeeper {
        width: 28px;
        height: 52px;
        margin-left: -14px;
    }

    .foot-goalkeeper.dive-left {
        transform: translate(-78px, -4px) rotate(-60deg);
    }

    .foot-goalkeeper.dive-right {
        transform: translate(78px, -4px) rotate(60deg);
    }

    .foot-ball {
        width: 20px;
        height: 20px;
        top: 216px;
        margin-left: -10px;
    }

    .foot-ball.kick-left {
        top: 80px;
        left: 55px;
    }

    .foot-ball.kick-center {
        top: 80px;
    }

    .foot-ball.kick-right {
        top: 80px;
        left: 205px;
    }
}
