@font-face {
    font-family: 'Custom';
    src: url('font.woff2') format('woff2'), /* Preferred format */
         url('font.otf') format('opentype'); /* Fallback for older browsers */
    font-display: swap;
}

body, html {
    margin: 0;
    padding: 0;
    overflow: hidden; 
    user-select: none; /* Prevent text selection */
}

#game-container {
  position: relative;
  background: radial-gradient(circle at center, #ebebeb 0%, #b8b8b8 100%);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.ball {
    position: absolute;
    border-radius: 50%; 
    background-color: black;
    z-index: 10; /* Adjust this if necessary */
}

.highscoretitle {
    font-family: 'Custom';
    font-size: 1.2em;
    color: #000000; /* Change as needed */
    margin-bottom: 30px;
    margin-top: 10px;
    text-align: center; /* Center the text */
}

#loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 8px solid #dcdcdc;
    border-top: 8px solid #00ff00;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    z-index: 200;
    display: none; 
    box-shadow: 0 0 5px #ffffff, 0 0 10px #ffffff, 0 0 15px #ffffff, 0 0 20px #ffffff;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.pulse {
    position: absolute;
    border-radius: 50%;
    opacity: 1;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    pointer-events: none; /* So that it doesn't block other clicks */
    z-index: 9; /* Ensure it appears behind the ball */
}

#pulsing-dot {
    width: 20px; /* Adjust the size as needed */
    height: 20px; /* Adjust the size as needed */
    border: 2px solid white;
    position: absolute;
    top: 14px; /* Adjust the position as needed */
    right: 14px; /* Adjust the position as needed */
    background-color: #fff; /* Default color, will change dynamically */
    animation: pulse 4s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.6);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes buttonpulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes scaleIn {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Game Over Popup */
#game-over-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none; /* Hidden by default */
    background-color: rgba(255, 255, 255, 0.4); 
    border-radius: 60px; /* Rounded corners */
    padding: 5px;
    width: 300px; /* Adjust width if needed */
    height: auto; /* Adjust height as needed */
    z-index: 100;
    box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.4);
    animation: scaleIn 0.2s ease-out; /* Apply the scale-in animation */

}

#button-container {
    display: flex; /* Use flexbox */
    flex-direction: column; /* Stack buttons vertically */
    align-items: center; /* Centre horizontally */
    margin-top: 20px; /* Add space above if needed */
}

.endtitle {
    font-family: 'Custom';
    text-align: center; 
    font-size: 3.2em;
    margin-bottom: 20px;
    color: #000000;
    text-shadow: 2px 2px 4px rgba(255, 20, 147, 0.8);
    z-index: 120;
}

#replay-button {
    padding: 6px 12px;
    font-family: 'Custom';
    font-size: 1.8em;
    color: #ffffff;
    background-color: #000000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Custom', sans-serif;
    transition: all 0.3s ease;
    animation: buttonpulse 2s infinite; /* Add the pulse animation */
}

#home-button {
    padding: 4px 9px;
    font-family: 'Custom';
    margin-top: 20px;
    margin-bottom: 50px;
    font-size: 1.23em;
    color: #ffffff;
    background-color: #000000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Custom', sans-serif;
    transition: all 0.3s ease;
}

#home-button:hover {
    background-color: #555;
}

#home:active {
    background-color: #333;
    box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(2px);
}

#replay-button:hover {
    background-color: #555;
}

#replay-button:active {
    background-color: #333;
    box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(2px);
}

#timer {
    position: fixed;
    top: 10px;
    left: 10px;
    font-family: 'Custom';
    font-size: 16px; /* Adjust size */
    color: #000000; 
    text-shadow: 0 0 10px #ffffff, 0 0 20px #ffffff, 0 0 30px #ffffff, 0 0 40px #ffffff; /* Neon glow effect */
    z-index: 1000;
}

#final-time {
    font-family: 'Custom';
    font-size: 1.5em;
    color: #000000; /* Change as needed */
    margin-bottom: 30px;
    margin-top: 10px;
    text-align: center; /* Center the text */
}

.message {
    font-size: 1.2em; /* Much smaller size */
    font-family: 'Custom';
    margin-bottom: 10px;
    color: #000000;
    text-shadow: 0 0 10px #ffffff, 0 0 20px #ffffff, 0 0 30px #ffffff, 0 0 40px #ffffff; /* Neon glow effect */
    position: absolute;
    top: 14px; /* Adjust to position near the top */
    right: 60px; /* Adjust the position as needed */
    transform: translateX(-100%);
    animation: pulsemessage 3s infinite;
    opacity: 0; /* Initially hidden */
    transition: opacity 1s ease; /* Smooth transition for fade */
}

@keyframes pulsemessage {
    0% {
        transform: translateX(0); /* Starting position */
    }
    50% {
        transform: translateX(10px); /* Move 10px to the right */
    }
    100% {
        transform: translateX(0); /* Move back to starting position */
    }
}