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

.game-container {
    width: 90vw;
    height: 90vh;
    background: linear-gradient(to top, #a3d8f4 0%, #87ceeb 60%, #e0f7fa 100%);
    position: relative;
    overflow: hidden;
    margin:0 auto; /* Center vertically and horizontally */
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.score-lives-bar {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    padding: 0 10px;
    font-family: Arial, sans-serif;
}

.score-group, .lives-group {
    display: flex;
    align-items: center;
}

.score-label, .lives-label {
    font-size: 2rem;
    color: #333;
    font-weight: bold;
    margin-right: 4px;
    margin-left: 0;
    text-shadow: 2px 2px 8px #fff, 0 0 2px #000;
    letter-spacing: 1px;
    pointer-events: auto;
}

#score {
    font-size: 2.5rem;
    color: #222;
    font-family: Arial, sans-serif;
    font-weight: bold;
    margin: 0;
    text-shadow: 2px 2px 8px #fff, 0 0 2px #000;
    letter-spacing: 2px;
    pointer-events: auto;
}

#lives {
    font-size: 2.5rem;
    color: #d32f2f;
    font-family: Arial, sans-serif;
    font-weight: bold;
    margin: 0;
    text-shadow: 2px 2px 8px #fff, 0 0 2px #000;
    letter-spacing: 2px;
    pointer-events: auto;
}

/* Apple Tree Styles */
.tree {
    position: absolute;
    bottom: 0;
    width: 100px;
    height: 300px;
    z-index: 0;
    transition: transform 0.4s cubic-bezier(.68,-0.55,.27,1.55);
}
.tree .trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 24px;
    height: 120px;
    background: #8b5c2a;
    border-radius: 12px;
    transform: translateX(-50%);
    box-shadow: 0 8px 10px rgba(0,0,0,0.15);
}
.tree .leaves {
    position: absolute;
    bottom: 100px;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 60% 40%, #5cb85c 70%, #387838 100%);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
    transition: filter 0.3s;
}
.tree .leaves2 {
    position: absolute;
    bottom: 170px;
    left: 50%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at 40% 60%, #6fdc6f 70%, #387838 100%);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 1;
    transition: filter 0.3s;
}
.tree .apple {
    position: absolute;
    width: 18px;
    height: 18px;
    background: radial-gradient(circle at 60% 30%, #ff6666 70%, #c80000 100%);
    border-radius: 50%;
    border: 1.5px solid #b22222;
    z-index: 2;
    transition: transform 0.3s;
}
.tree .apple1 { left: 40px; bottom: 180px; }
.tree .apple2 { left: 65px; bottom: 230px; }
.tree .apple3 { left: 70px; bottom: 140px; }
.tree .apple4 { left: 25px; bottom: 210px; }

.tree:hover {
    transform: rotate(-4deg) scale(1.04);
}
.tree:hover .leaves,
.tree:hover .leaves2 {
    filter: brightness(1.1) drop-shadow(0 0 8px #b6ffb6);
}
.tree:hover .apple {
    animation: apple-jiggle 0.5s alternate infinite;
}

@keyframes apple-jiggle {
    0% { transform: translateY(0) rotate(-5deg);}
    50% { transform: translateY(-6px) rotate(5deg);}
    100% { transform: translateY(0) rotate(-5deg);}
}

.stats {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.score, .lives {
    color: white;
    font-size: 24px;
    font-family: Arial, sans-serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.lives i {
    color: red;
    margin-left: 10px;
}

.fruit {
    width: 60px;
    height: 60px;
    background: #ff4242;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.basket {
    width: 120px;
    height: 60px;
    background: repeating-linear-gradient(
        135deg,
        #a0522d 0 10px,
        #8b4513 10px 20px
    );
    border-bottom-left-radius: 60px 40px;
    border-bottom-right-radius: 60px 40px;
    border-top-left-radius: 30px 20px;
    border-top-right-radius: 30px 20px;
    border: 4px solid #7b3f00;
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    overflow: hidden;
    transition: left 0.2s ease-out;
}
.basket::before {
    content: '';
    position: absolute;
    top: -28px;
    left: 20px;
    width: 80px;
    height: 40px;
    border: 6px solid #a0522d;
    border-bottom: none;
    border-radius: 40px 40px 0 0;
    background: transparent;
    z-index: 2;
}
.basket::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background: linear-gradient(to top, #7b3f00 60%, transparent 100%);
    border-bottom-left-radius: 60px 20px;
    border-bottom-right-radius: 60px 20px;
    z-index: 1;
}

.basket-front {
    width: 120px;
    height: 60px;
    background: #8B4513;
    border: 5px solid #654321;
    border-radius: 0 0 50% 50%;
    position: relative;
}

.basket-handle {
    width: 60px;
    height: 30px;
    border: 5px solid #654321;
    border-bottom: none;
    border-radius: 30px 30px 0 0;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 48px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.mode-switch {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.mode-switch button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
}

.apple {
    width: 54px;
    height: 54px;
    background: radial-gradient(circle at 60% 30%, #ff6666 70%, #c80000 100%);
    border-radius: 50% 50% 48% 52% / 48% 52% 50% 50%;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    font-family: Arial, sans-serif;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    z-index: 10;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}
.apple::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    width: 8px;
    height: 18px;
    background: #7a4a13;
    border-radius: 4px;
    transform: translateX(-50%) rotate(-18deg);
    z-index: 2;
}
.apple::after {
    content: '';
    position: absolute;
    top: -18px;
    left: 60%;
    width: 18px;
    height: 10px;
    background: #3fa34d;
    border-radius: 0 80% 80% 80%;
    transform: rotate(-25deg);
    z-index: 1;
}

#basket {
    width: 120px;
    height: 40px;
    background: brown;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 20px 20px;
}

#ball {
    width: 20px;
    height: 20px;
    background: red;
    border-radius: 50%;
    position: absolute;
    top: 0;
}

#paddle {
    width: 100px;
    height: 20px;
    background: white;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.falling-item {
    position: absolute;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.power-up {
    color: gold;
    font-size: 30px;
    animation: glow 1s infinite alternate;
    text-shadow: 0 0 10px gold;
}

@keyframes glow {
    from {
        filter: brightness(100%);
    }
    to {
        filter: brightness(150%);
    }
}

/* Overlay base styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 44, 44, 0.85);
    z-index: 1000;
}

/* Overlay content for welcome card */
.overlay-content.welcome-card {
    background: linear-gradient(135deg, #b9b9b87a 70%, #ad1899 100%);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    padding: 36px 32px 28px 32px;
    min-width: 320px;
    max-width: 90vw;
    margin: 0 auto;
    position: relative;
    animation: pop-in 0.7s cubic-bezier(.68,-0.55,.27,1.55);
    text-align: center;
}

@keyframes pop-in {
    0% { transform: scale(0.7) translate(-50%, -50%); opacity: 0; }
    80% { transform: scale(1.05) translate(-50%, -50%); opacity: 1; }
    100% { transform: scale(1) translate(-50%, -50%); }
}

.welcome-emoji {
    font-size: 3.5rem;
    margin-bottom: 10px;
    animation: bounce 1.2s infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0);}
    100% { transform: translateY(-10px);}
}

.instructions-list {
    text-align: left;
    margin: 18px 0 20px 0;
    padding-left: 0;
    list-style: none;
}

.instructions-list li {
    font-size: 1.15rem;
    margin-bottom: 10px;
    padding-left: 0;
    color: #333;
    display: flex;
    align-items: center;
}

.kbd {
    background: #eee;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 2px 8px;
    font-family: 'Consolas', monospace;
    font-size: 1rem;
    margin: 0 2px;
    box-shadow: 1px 1px 2px #bbb;
}

.start-btn {
    margin-top: 10px;
    padding: 12px 32px;
    font-size: 1.2rem;
    background: linear-gradient(90deg, #4CAF50 60%, #81c784 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(76,175,80,0.15);
    transition: background 0.2s, transform 0.2s;
}

.start-btn:hover {
    background: linear-gradient(90deg, #388e3c 60%, #66bb6a 100%);
    transform: scale(1.04);
}

#gameOverOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#gameOverOverlay .overlay-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 36px 32px 28px 32px;
    min-width: 320px;
    max-width: 90vw;
    margin: 20px;
    text-align: center;
    position: relative;
}

/* Footer Styles */
.main-footer {
    position: relative;
}

/* Contact Modal Styles */
.typing_contact_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.typing_contact_modal_content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.typing_contact_close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.typing_contact_close:hover {
    color: #333;
}

.typing_contact_form {
    margin-top: 20px;
}

.typing_contact_form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.typing_contact_form input,
.typing_contact_form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.typing_contact_form input:focus,
.typing_contact_form textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.typing_contact_mandatory {
    color: #e74c3c;
    margin-left: 3px;
}

.typing_contact_send_btn {
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s;
    width: 100%;
}

.typing_contact_send_btn:hover {
    background: #45a049;
}

.typing_contact_success {
    display: none;
    color: #4CAF50;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 5px;
}

.typing_contact_honeypot {
    display: none;
}