@font-face {
    font-family: 'Cairo';
    src: url('Cairo-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', Arial, sans-serif;
    background: #2797d4;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    background: #2a9ad4;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.field-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 15px;
    overflow: hidden;
    background: #2d5016;
}

.background {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 0;
}

.goal-area {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 60px));
    width: 34%;
    height: 45%;
    z-index: 10;
}

.goal-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.goal-grid {
    position: relative;
    width: 100%;
    height: 100%;
}

.goal-zone {
    position: absolute;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5vw;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 1),
                 2px 2px 4px rgba(0, 0, 0, 1),
                 0 0 15px rgba(0, 0, 0, 0.9),
                 -1px -1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
    width: 25%;
    height: 30%;
}

.goal-zone[data-zone="top-left"] {
    top: calc(35% + 30px);
    left: 3%;
}

.goal-zone[data-zone="top-right"] {
    top: calc(35% + 30px);
    right: 3%;
}

.goal-zone[data-zone="bottom-left"] {
    bottom: calc(5% - 60px);
    left: 3%;
}

.goal-zone[data-zone="bottom-right"] {
    bottom: calc(5% - 60px);
    right: 3%;
}


.goal-zone:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #ffd700;
    transform: scale(1.05);
    z-index: 5;
}

.ball-container {
    position: absolute;
    bottom: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    z-index: 20;
    pointer-events: none;
}

.ball {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.ball.shooting {
    transform: scale(0.8);
}

.keeper-container {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 34%;
    height: 60%;
    z-index: 15;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.keeper {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    object-position: center bottom;
    will-change: transform;
}

.keeper.diving-top-left {
    animation: diveTopLeft 0.8s ease-in-out forwards;
}

.keeper.diving-top-right {
    animation: diveTopRight 0.8s ease-in-out forwards;
}

.keeper.diving-bottom-left {
    animation: diveBottomLeft 0.8s ease-in-out forwards;
}

.keeper.diving-bottom-right {
    animation: diveBottomRight 0.8s ease-in-out forwards;
}

@keyframes diveTopLeft {
    0% { transform: translate(0, 0); }
    80% { transform: translate(-40px, -30px); }
    100% { transform: translate(-40px, -30px); }
}

@keyframes diveTopRight {
    0% { transform: translate(0, 0); }
    80% { transform: translate(40px, -30px); }
    100% { transform: translate(40px, -30px); }
}

@keyframes diveBottomLeft {
    0% { transform: translate(0, 0); }
    80% { transform: translate(-70px, 20px); }
    100% { transform: translate(-70px, 20px); }
}

@keyframes diveBottomRight {
    0% { transform: translate(0, 0); }
    80% { transform: translate(70px, 20px); }
    100% { transform: translate(70px, 20px); }
}


.result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.result-overlay.show {
    display: flex;
}

.wipe-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    pointer-events: none;
}

.wipe-animation img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.goal-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 150;
    pointer-events: none;
}

.goal-animation img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-text {
    font-size: 120px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                 0 0 40px rgba(255, 255, 255, 0.6),
                 0 0 60px rgba(255, 255, 255, 0.4);
    animation: resultPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.result-text.goal {
    color: #4ade80;
}

.result-text.save {
    color: #fbbf24;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes resultPop {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.instructions {
    text-align: center;
    margin-top: 20px;
    color: #fff;
}

.instructions h2 {
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.score-label {
    font-size: 18px;
    color: #fff;
    margin-bottom: 2px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.score-value {
    font-size: 90px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .goal-area {
        width: 40%;
        height: 45%;
    }

    .goal-zone {
        font-size: 4vw;
    }

    .ball-container {
        width: 100px;
        height: 100px;
    }

    .result-text {
        font-size: 80px;
    }

    .instructions h2 {
        font-size: 18px;
    }
}