/* 1. CUSTOM FONT REGISTRATION */
@font-face {
    font-family: 'FruitNinjaFont';
    src: url('assets/fonts/Freckle_Face/FreckleFace-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 2. RESET & BASE LAYOUT */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background: url('assets/images/background.png') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    min-height: 100vh;
    font-family: 'FruitNinjaFont', cursive;
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* Keeps the fruit from causing scrollbars */
    perspective: 1000px; /* Enables the 3D depth for the button tilt */
}

/* 3. VIGNETTE LIGHTING EFFECT */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Darkens corners to make the center content "pop" */
    background: radial-gradient(circle, transparent 30%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 5;
}

/* 4. FLOATING TITLE & LINE */
.title-container {
    width: 100vw;
    text-align: center;
    padding-top: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Gentle floating animation */
    animation: floatTitle 4s ease-in-out infinite;
}

.title-text {
    font-size: 7rem;
    color: #040404;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 
        3px 3px 0px #ffffff, 
        6px 6px 0px rgba(0,0,0,0.4);
}

.title-line {
    width: 700px;
    max-width: 90vw;
    height: auto;
    margin-top: -15px;
    pointer-events: none;
    filter: brightness(0);
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 5. MENU BUTTONS & YOUR SPECIFIC ICON POSITIONS */
.menu-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-bg {
    display: block;
    width: 260px;
    height: auto;
}

.btn-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    height: auto;
    pointer-events: none;
}

/* --- START OF YOUR CUSTOM COORDINATES --- */
.singleplayer .btn-icon {
    width: 20%;
    /* Centered with no additional nudge */
    transform: translate(-50%, -50%);
}

.multiplayer .btn-icon {
    width: 60%;
    /* Custom horizontal shift to the right */
    transform: translate(-35%, -50%);
}

.leaderboard .btn-icon {
    width: 60%;
    /* Custom horizontal shift slightly to the right */
    transform: translate(-45%, -50%);
}
/* --- END OF YOUR CUSTOM COORDINATES --- */

/* 6. BUTTON HOVER (3D TILT & GLOW) */
.menu-btn:hover {
    /* translate keeps it centered, scale makes it pop, rotate adds the tilt */
    transform: translate(-50%, -50%) scale(1.1) rotate(3deg);
    filter: brightness(1.2) drop-shadow(0 15px 15px rgba(0,0,0,0.5));
}

.menu-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Button placement on screen */
.leaderboard { top: 75%; left: 50%; transform: translate(-50%, -50%); }
.singleplayer { top: 50%; left: 30.33%; transform: translate(-50%, -50%); }
.multiplayer { top: 50%; left: 69.66%; transform: translate(-50%, -50%); }

/* 7. CURVED TEXT LABELS */
.curved-text-svg {
    position: absolute;
    width: 320px;
    height: 160px;
    bottom: -75px;
    pointer-events: none;
    overflow: visible;
}

.curved-text-svg text {
    color: rgb(0, 0, 0);
    font-family: 'FruitNinjaFont', cursive;
    font-size: 26px;
    text-shadow: 6px 6px 0px rgba(255, 255, 255, 0.9);
}

.mute-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: none; /* Removed background to show just the PNG */
    border: none;     /* Removed border */
    width: 60px;
    height: 60px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
}

.mute-control img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Optional: adds a glow to your PNGs to help them pop */
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.mute-control:hover {
    transform: scale(1.1);
}

/* MODAL & BLUR EFFECT */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px); /* The blur effect */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-title {
    color: #000000; /* Change this hex code to your preferred color */
    font-size: 4rem;
    margin-bottom: 20px;
    /* This white shadow helps it pop against the wood background */
    text-shadow: 2px 2px 0px #ffffff, -1px -1px 0px #ffffff;
    font-family: 'FruitNinjaFont', cursive;
}

.modal-overlay {
    /* ... your existing styles ... */
    transition: opacity 0.4s ease; /* Adds a fade to the background blur */
}

/* 1. Modal Card - Black Border */
.leaderboard-card {
    background: url('assets/images/background.png') no-repeat center center;
    background-size: cover;
    border: 8px solid #000000a8; /* Changed to Solid Black */
    padding: 40px;
    border-radius: 20px;
    width: 450px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 40px rgba(167, 149, 149, 0.306);
}

/* 2. Custom Exit Button Styles */
.close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    padding: 0;
    z-index: 210;
    transition: transform 0.2s;
}

.exit-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

.close-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

/* 3. Rank Color Coding (Gold, Silver, Bronze) */
.score-list li {
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 3px solid transparent;
    transition: transform 0.3s;
    font-size: 2rem;
}

.rank-gold { 
    border-color: #FFD700 !important; 
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    text-shadow: 1px 1px 0px rgb(255, 255, 255);
}

.rank-silver { 
    border-color: #C0C0C0 !important; 
    background: rgba(192, 192, 192, 0.1);
    text-shadow: 1px 1px 0px rgb(255, 255, 255);

}

.rank-bronze { 
    border-color: #CD7F32 !important; 
    background: rgba(205, 127, 50, 0.1);
    text-shadow: 1px 1px 0px rgb(255, 255, 255);
}

/* Make sure the text still pops */
.score-list li span.rank {
    font-weight: bold;
}

/* CURSOR LOGIC */
body {
    cursor: none; /* Hide default for blade */
}

/* When  is open, bring the normal cursor back and hide the blade cursor */
body.modal-open {
    cursor: auto;
}

body.modal-open .blade-trail {
    display: none;
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 8. SEAMLESS FALLING FRUIT ANIMATION */
.fruit-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.falling-fruit {
    position: absolute;
    top: -250px; 
    width: 140px; 
    filter: drop-shadow(15px 15px 10px rgba(0,0,0,0.6));
    animation: fall linear infinite;
}



@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(140vh) rotate(450deg); }
}

/* Staggered fruit timing and positions for a random feel */
.f1 { left: 5%;  animation-duration: 9s;  animation-delay: -2s; }
.f2 { left: 20%; animation-duration: 13s; animation-delay: -5s; }
.f3 { left: 35%; animation-duration: 11s; animation-delay: -8s; }
.f4 { left: 50%; animation-duration: 16s; animation-delay: -1s; }
.f5 { left: 65%; animation-duration: 10s; animation-delay: -4s; }
.f6 { left: 80%; animation-duration: 14s; animation-delay: -11s; }
.f7 { left: 90%; animation-duration: 12s; animation-delay: -6s; }
.f8 { left: 12%; animation-duration: 18s; animation-delay: -3s; }

/* 1. Hide the default cursor so the blade is the focus */
body {
    cursor: none; 
}

/* 2. Ensure buttons still feel clickable */
.menu-btn {
    cursor: none; 
}

/* 3. The Blade Trail Particle */
.blade-trail {
    position: absolute;
    width: 10px;   /* Thin like a blade */
    height: 10px; /* Long trail */
    background: #ffffff; /* Cyan glow */
    transform: rotate(45deg); /* Angled slash */
    box-shadow: 0 0 15px #ffffff;
    animation: slashFade 0.4s ease-out forwards;
}

/* 4. Animation to make the trail shrink and fade out */
@keyframes slashFade {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.1);
        opacity: 0;
    }
}

@keyframes popIn {
    from { 
        transform: scale(0.9); /* Start slightly smaller */
        opacity: 0;           /* Start invisible */
        filter: blur(5px);    /* Optional: start slightly blurry */
    }
    to { 
        transform: scale(1);   /* End at full size */
        opacity: 1;           /* End fully visible */
        filter: blur(0);      /* End perfectly clear */
    }
}

/* Update the card to use this smoother timing */
.leaderboard-card {
    /* ... your existing styles ... */
    animation: popIn 0.5s cubic-bezier(0.25, 1, 0.5, 1); /* Slower, smoother ease-out */
}

.name-input {
    width: 80%;
    padding: 12px 16px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;

    background: rgba(0, 0, 0, 0.4);
    color: white;

    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;

    outline: none;
    transition: 0.2s ease;
    margin: 10px 0;
}

/* Glow on focus */
.name-input:focus {
    border-color: #ffcc4d;
    box-shadow: 0 0 12px #ffcc4d;
}
