* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Comic Sans MS', Arial, sans-serif;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Navigation bar container - full width, not affected by body center alignment */
#navbar {
    width: 100%;
    align-self: stretch;
}

#navbar nav {
    width: 100%;
}

/* Footer container - full width, not affected by body center alignment */
#footer {
    width: 100%;
    align-self: stretch;
}

#footer footer {
    width: 100%;
}

.game-container {
    width: 100%;
    max-width: 600px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 60px;
}

h1 {
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin: 5px 0;
    font-size: 2.5em;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.score-board {
    background: transparent;
    border-radius: 15px;
    padding: 0px;
    margin: 10px 0;
    box-shadow: none;
    width: 100%;
    max-width: 500px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    text-align: center;
}

.score-item {
    display: flex;
    flex-direction: column;
}

.score-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.score-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #ff6b6b;
}

.esp-level {
    color: #4CAF50;
}

.game-area {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 450px;
    margin: 20px 0;
}

.tree {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 250px;
}

.trunk {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 100px;
    background: linear-gradient(to right, #8B4513, #A0522D);
    border-radius: 5px;
    z-index: 1;
}

.foliage {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 200px;
    background: radial-gradient(ellipse at center, #228B22, #006400);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: visible;
    animation: gentleSway 4s ease-in-out infinite;
}

@keyframes gentleSway {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(1deg); }
}

/* Main tree canopy with natural shape */
.foliage::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -25px;
    right: -25px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, #32CD32, #228B22);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    z-index: -1;
    filter: blur(5px);
}

/* Secondary canopy layer */
.foliage::after {
    content: '';
    position: absolute;
    top: -35px;
    left: -40px;
    right: -40px;
    bottom: -30px;
    background: radial-gradient(ellipse at center, #90EE90, #32CD32);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    z-index: -2;
    filter: blur(8px);
}

/* Tree branches structure */
.tree-branch {
    position: absolute;
    background: linear-gradient(to bottom, #8B4513, #654321);
    border-radius: 50px;
    z-index: 5;
}

.branch-main {
    width: 15px;
    height: 120px;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, #8B4513, #654321);
}

.branch-left {
    width: 7px;
    height: 80px;
    top: 60px;
    left: 30%;
    transform: rotate(-25deg);
    transform-origin: top center;
}

.branch-right {
    width: 7px;
    height: 80px;
    top: 60px;
    right: 30%;
    transform: rotate(25deg);
    transform-origin: top center;
}

.branch-small-left {
    width: 3px;
    height: 50px;
    top: 80px;
    left: 25%;
    transform: rotate(-40deg);
    transform-origin: top center;
}

.branch-small-right {
    width: 3px;
    height: 50px;
    top: 80px;
    right: 25%;
    transform: rotate(40deg);
    transform-origin: top center;
}

/* Leaf clusters for more realistic appearance */
.leaf-cluster {
    position: absolute;
    background: radial-gradient(circle at center, #32CD32, #228B22);
    border-radius: 50%;
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.leaf-cluster:nth-child(1) {
    width: 70px;
    height: 70px;
    top: -25px;
    left: 60px;
    background: radial-gradient(circle at center, #90EE90, #32CD32);
}

.leaf-cluster:nth-child(2) {
    width: 85px;
    height: 85px;
    top: -35px;
    right: 70px;
    background: radial-gradient(circle at center, #98FB98, #90EE90);
}

.leaf-cluster:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 15px;
    left: -20px;
    background: radial-gradient(circle at center, #32CD32, #228B22);
}

.leaf-cluster:nth-child(4) {
    width: 75px;
    height: 75px;
    top: 25px;
    right: -25px;
    background: radial-gradient(circle at center, #90EE90, #32CD32);
}

.leaf-cluster:nth-child(5) {
    width: 55px;
    height: 55px;
    bottom: -20px;
    left: 90px;
    background: radial-gradient(circle at center, #228B22, #006400);
}

.leaf-cluster:nth-child(6) {
    width: 65px;
    height: 65px;
    bottom: -25px;
    right: 100px;
    background: radial-gradient(circle at center, #32CD32, #228B22);
}

/* Additional smaller leaf details */
.leaf-detail {
    position: absolute;
    background: #90EE90;
    border-radius: 50%;
    opacity: 0.7;
}

.leaf-detail:nth-child(7) {
    width: 30px;
    height: 30px;
    top: 10px;
    left: 45%;
}

.leaf-detail:nth-child(8) {
    width: 25px;
    height: 25px;
    top: 50px;
    left: 35%;
}

.leaf-detail:nth-child(9) {
    width: 35px;
    height: 35px;
    top: 70px;
    right: 40%;
}

.leaf-detail:nth-child(10) {
    width: 20px;
    height: 20px;
    top: 100px;
    left: 50%;
}

/* Tree texture and depth effects */
.foliage {
    background: 
        radial-gradient(circle at 30% 30%, #90EE90 0%, transparent 50%),
        radial-gradient(circle at 70% 40%, #98FB98 0%, transparent 50%),
        radial-gradient(circle at 50% 60%, #32CD32 0%, transparent 50%),
        radial-gradient(ellipse at center, #228B22, #006400);
}

/* Add some natural variation to leaf clusters */
.leaf-cluster:nth-child(odd) {
    animation: leafRustle 3s ease-in-out infinite;
}

.leaf-cluster:nth-child(even) {
    animation: leafRustle 3s ease-in-out infinite reverse;
}

@keyframes leafRustle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(1deg); }
}

/* Make branches look more woody */
.tree-branch {
    box-shadow: 
        inset 2px 2px 4px rgba(255,255,255,0.1),
        inset -2px -2px 4px rgba(0,0,0,0.3);
}

/* Add some natural color variation to the trunk */
.trunk {
    background: 
        linear-gradient(to bottom, #8B4513, #A0522D),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 10px,
            rgba(139, 69, 19, 0.3) 10px,
            rgba(139, 69, 19, 0.3) 20px
        );
}

.apples-container {
    position: absolute;
    bottom: 115px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.apple {
    position: relative;
    width: 35px;
    height: 35px;
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #dc143c);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    cursor: pointer;
    z-index: 10;
}

.apple:hover {
    transform: scale(1.1);
}

.apple::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 8px;
    background: #654321;
}

.apple::after {
    content: '';
    position: absolute;
    top: -3px;
    right: 10px;
    width: 10px;
    height: 8px;
    background: #228B22;
    border-radius: 50% 0;
    transform: rotate(45deg);
}

@keyframes fallStraight {
    0% { 
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    95% {
        opacity: 0.5;
    }
    100% { 
        transform: translateY(300px) rotate(720deg);
        opacity: 0;
    }
}

.falling {
    animation: fallStraight 1.2s ease-in forwards;
    z-index: 30 !important; /* Lower than buckets but higher than trunk */
}

.buckets-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 200; /* Make sure the entire container is on top */
}

.bucket-position {
    width: 55px;
    height: 60px;
    background: linear-gradient(to bottom, #8B7355, #654321);
    border-radius: 0 0 20px 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.3em;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    border: 2px solid #654321;
    z-index: 100; /* Higher than falling apples to catch them */
    overflow: hidden;
}

.bucket-position::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -2px;
    right: -2px;
    height: 8px;
    background: linear-gradient(to bottom, #A0826D, #8B7355);
    border-radius: 50%;
    z-index: 101; /* Even higher for the bucket rim */
}

.bucket-position:hover {
    transform: scale(1.1);
    background: linear-gradient(to bottom, #A0826D, #8B4513);
}

.bucket-position.selected {
    background: linear-gradient(to bottom, #FFD700, #FFA500);
    border-color: #FFA500;
    transform: scale(1.1);
}

@keyframes successGlow {
    0%, 100% { 
        box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
        background: linear-gradient(to bottom, #4CAF50, #45a049);
    }
}

.bucket-success {
    animation: successGlow 1s ease;
}

.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 40px;
    border-radius: 20px;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}

.message.show {
    display: block;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.message.success {
    color: #4CAF50;
    border: 3px solid #4CAF50;
}

.message.miss {
    color: #ff6b6b;
    border: 3px solid #ff6b6b;
}

/* Game Over Modal Styles */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.game-over-modal.show {
    display: flex;
    animation: modalFadeIn 0.5s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    color: #ff6b6b;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.final-score {
    margin: 25px 0;
}

.final-score p {
    font-size: 1.3em;
    margin: 10px 0;
    color: #333;
}

.final-score p:first-child {
    font-weight: bold;
    color: #667eea;
    font-size: 1.5em;
}

#scoreMessage {
    font-size: 1.4em;
    font-weight: 600;
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.replay-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.replay-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.yes-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.yes-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.no-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.no-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.instructions {
    background: transparent;
    border-radius: 15px;
    padding: 0px;
    margin: 5px 0;
    text-align: center;
    box-shadow: none;
    width: 100%;
}

.instructions h3 {
    color: #ff6b6b;
    margin-bottom: 10px;
}

.instructions p {
    color: #666;
    line-height: 1.5;
}

/* Prime Numbers Container Styles */
.prime-numbers-container {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 5px;
    margin: 0;
    padding: 15px;
    overflow-x: auto;
    max-width: 100%;
}

.prime-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #FFD700;
    font-weight: bold;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    border: 2px solid #45a049;
    flex-shrink: 0;
}

.prime-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #45a049, #4CAF50);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.prime-btn.selected {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #4CAF50;
    border-color: #FFA500;
    transform: scale(1.1);
}

/* Number Sequence Container Styles */
.number-sequence-container {
    background: transparent;
    border-radius: 15px;
    padding: 0;
    margin: 0;
    text-align: center;
    box-shadow: none;
    backdrop-filter: none;
    border: none;
}

.sequence-label {
    font-size: 1.2em;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 10px;
}

.sequence-display {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    font-family: 'Courier New', monospace;
    background: transparent;
    padding: 0;
    border-radius: 10px;
    border: none;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ready-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin: 15px auto 0;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.ready-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #45a049, #4CAF50);
}

.ready-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    h1 { font-size: 2em; }
    .score-board { grid-template-columns: 1fr; }
    .tree { width: 320px; }
    .foliage { width: 320px; }
    .apples-container { width: 320px; padding: 0 10px; }
    .buckets-container { width: 320px; padding: 0 10px; }
    .bucket-position { width: 50px; height: 55px; font-size: 1.1em; }
    .apple { width: 30px; height: 30px; }
    
    /* Mobile Prime Numbers Layout - 2 rows of 5 buttons */
    .prime-numbers-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        max-width: 280px;
        margin: 20px auto;
    }
    
    .prime-btn {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
}

/* Copyright Footer Styles */
.copyright-footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(102, 126, 234, 0.3);
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.copyright-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.copyright-content p {
    margin: 5px 0;
    color: #555;
    font-size: 0.9rem;
    font-weight: 400;
}

.copyright-content p:first-child {
    font-weight: 500;
    color: #667eea;
}

.copyright-content p:last-child {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

@media (max-width: 768px) {
    .copyright-footer {
        margin-top: 30px;
        padding: 15px 0;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
    }
    
    .copyright-content p {
        font-size: 0.8rem;
    }
    
    .copyright-content p:last-child {
        font-size: 0.75rem;
    }
    
    /* Mobile scoreboard layout - 2 rows with captions on top, values below */
    .score-board {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, auto);
        gap: 15px;
        padding: 20px;
    }
    
    .score-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .score-label {
        font-size: 1em;
        margin-bottom: 8px;
        order: 1;
    }
    
    .score-value {
        font-size: 1.3em;
        order: 2;
    }
}

