@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Roboto:wght@300;400;700&display=swap');

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
    background-color: #1a1a1a;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-image: url('/FruitNinja/assets/images/background.png');
    /* Fallback needed if missing? */
    background: radial-gradient(circle at center, #c2bebe 0%, #000000 20%);
    /* Premium Fallback */
    background-size: cover;
    background-position: center;
}

/* Ensure background image is used if it exists, over the gradient */

#game-container {
    background-image: url('/FruitNinja/assets/images/background.png'), radial-gradient(circle at center, #595959 30%, #181717 100%);
    background-blend-mode: overlay;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* Subtle glow for the canvas content */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#score {
    position: absolute;
    top: clamp(10px, 3vh, 30px);
    left: clamp(10px, 3vw, 40px);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(24px, 5vw, 56px);
    color: #ffeb3b;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.5), 3px 3px 0px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

#fruit-stats {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    text-align: right;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

#fruit-stats div {
    margin-bottom: 5px;
    color: #e0e0e0;
}

#fruit-stats span {
    color: #ffeb3b;
    font-weight: bold;
    margin-left: 10px;
}

#game-over,
#start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.85);
    /* Darker, cleaner */
    padding: 60px 80px;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.hidden {
    display: none !important;
}

.game-title,
h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 80px;
    margin: 0 0 20px 0;
    background: linear-gradient(to right, #ff9800, #ff5722);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 87, 34, 0.4);
    text-transform: uppercase;
    letter-spacing: 4px;
}

.game-subtitle,
p {
    font-size: 24px;
    margin-bottom: 40px;
    color: #ccc;
    font-weight: 300;
}

/* BUTTONS */
button {
    padding: 15px 50px;
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

.glow-on-hover {
    background: linear-gradient(45deg, #ff357a, #fff172, #ff357a);
    background-size: 200% auto;
    box-shadow: 0 0 20px #ff357a80;
    z-index: 1;
}

.glow-on-hover:hover {
    background-position: right center;
    transform: scale(1.05);
    box-shadow: 0 0 30px #ff357a;
}

.secondary-btn {
    background: transparent;
    border: 2px solid #666;
    color: #aaa;
    margin-top: 20px;
    font-size: 18px;
    padding: 10px 30px;
}

.secondary-btn:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* LEADERBOARD */
#leaderboard-container {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

#leaderboard-container h3 {
    margin-top: 0;
    color: #FFD700;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    color: #eee;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    line-height: 1.6;
}

/* INPUT STYLING */
#name-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

#player-name {
    padding: 15px;
    font-size: 24px;
    text-align: center;
    width: 250px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    outline: none;
    transition: 0.3s;
}

#player-name:focus {
    border-color: #ffeb3b;
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.3);
}

#player-name::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#music-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 2px solid #00BFFF;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    pointer-events: auto;
    /* Ensure it can be clicked */
}

#music-toggle:hover {
    background: #00BFFF;
    color: #000;
    box-shadow: 0 0 15px #00BFFF;
}