html, body {
    height: 100%;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    overflow: hidden;
    margin: 0;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 2s infinite;
}

@keyframes twinkle {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    display: none; /* Hidden by default */
}

#mobileInput {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden; /* Prevent scrollbars */
}



.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: Arial, sans-serif;
    z-index: 10;
}

#startScreen h1 .typing-text {
    font-family: sans-serif;
    font-weight: normal;
}

#startScreen h1 .dot-logo {
    display: inline-block;
    background-color: #00ffff;
    color: #16213e;
    border-radius: 50%;
    width: 1.6em;
    height: 1.6em;
    line-height: 1.6em;
    text-align: center;
    margin-right: 0.2em;
    padding: 0.1em;
    font-weight: bold;
    font-family: sans-serif;
}

#startScreen h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

#startButton {
    padding: 20px 40px;
    font-size: 6rem;
    font-weight: bold;
    background-color: #007bff00;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#startScreen p {
    font-size: 0.9em;
    margin-top: 20px;
    color: #ccc;
}

#gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: Arial, sans-serif;
    z-index: 10;
}

#gameOverScreen h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

#gameOverScreen p {
    font-size: 1.5em;
    margin-bottom: 10px;
}

#statsContainer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

#chartContainer {
    position: relative;
    width: 300px;
    height: 150px;
    margin-bottom: 20px;
}

#restartButton {
    padding: 15px 30px;
    font-size: 1.5em;
    background-color: #00ffee;
    color: #16213e;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#restartButton:hover {
    background-color: #00b3b3;
}

#infoButton {
    margin-top: 20px;
    color: white;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 1.2em;
}

#infoButton:hover {
    text-decoration: underline;
}

#soundControls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center; /* This will vertically align the buttons */
    gap: 10px;
}

#infoButton, #soundButton {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 0;
    line-height: 1;
}

#infoButton:hover, #soundButton:hover {
    transform: scale(1.1);
}

#soundPopup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(27, 39, 53, 0.5); /* Semi-transparent dark blue */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    padding: 25px;
    border-radius: 15px;
    color: white;
    z-index: 20;
    font-family: Arial, sans-serif;
    width: 280px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2); /* Lighter cyan border */
}

#soundPopup h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-weight: normal;
    color: #00ffff; /* Cyan title */
}

.sound-toggle, .volume-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: #e0e0e0; /* Light grey text from info page */
}

.sound-toggle label, .volume-control label {
    justify-self: start;
}

/* Custom Toggle Switch */
.sound-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.sound-toggle .switch {
    justify-self: end;
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.sound-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #090a0f; /* Darkest blue from background */
    transition: .4s;
    border-radius: 28px;
}

.sound-toggle .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.sound-toggle input:checked + .slider {
    background-color: #00ffff; /* Cyan */
}

.sound-toggle input:checked + .slider:before {
    transform: translateX(22px);
}

/* Custom Range Slider */
.volume-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #090a0f; /* Darkest blue from background */
    border-radius: 5px;
    outline: none;
    justify-self: end;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #00ffff; /* Cyan */
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #00ffff; /* Cyan */
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid white;
}


#closeSoundPopup {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #00ffff; /* Cyan */
    color: #16213e; /* Dark blue text */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

#closeSoundPopup:hover {
    background-color: #00b3b3; /* Darker cyan */
}