@import url('https://fonts.googleapis.com/css?family=Voltaire');

/* Ensure the game fills the viewport and never shows scrollbars */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* hide scrollbars while the game runs */
}

#world {
    position: fixed; /* fixed keeps it tied to viewport and prevents layout overflow */
    inset: 0; /* top:0; right:0; bottom:0; left:0; */
    background-color: #7FFFD4;
    overflow: hidden;
}


#gameoverInstructions {
    position: absolute;
    font-family: 'Pacifico', cursive;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 100px;
    text-align: center;
    color: #f80850;
    opacity: 0;
    left: 50%;
    top: 50%;
    width: 100%;
    transform: translate(-50%, -100%);
    user-select: none;
    transition: all 500ms ease-in-out;

}

/* Visible state for game over message */
#gameoverInstructions.show {
    opacity: 1;
    transform: translate(-50%, -50%);
    transition: all 500ms ease-in-out;
}

.button {
    display: inline-block;
    margin: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    outline: none;
}

.green {
    background-color: green;
    color: white;
}

.red {
    background-color: red;
    color: white;
}

.blue {
    background-color: blue;
    color: white;
}


#dist {
    position: absolute;
    left: 50%;
    top: 50px;
    transform: translate(-50%, 0%);
    user-select: none;
}

.label {
    position: relative;
    font-family: 'Open Sans', sans-serif;
    text-transform: uppercase;
    color: #FF4500;
    font-size: 23px;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 5px;

}


#distValue {
    position: relative;
    text-transform: uppercase;
    color: #FF6347;
    font-size: 40px;
    font-family: 'Voltaire';
    text-align: center;
}


#credits {
    position: absolute;
    width: 100%;
    margin: auto;
    bottom: 0;
    margin-bottom: 20px;
    font-family: 'Arial', sans-serif;
    color: #544027;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    user-select: none;
}

#credits a {
    color: #544027;

}

#credits a:hover {
    color: #dc5f45;
}

#instructions {
    position: absolute;
    width: 100%;
    bottom: 0;
    margin: auto;
    margin-bottom: 50px;
    font-family: 'Roboto', sans-serif;
    color: hsl(315, 97%, 50%);
    font-size: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    user-select: none;
}

.lightInstructions {
    color: #211ed4;
    font-family: 'Roboto', sans-serif;
}

#controls {
    position: fixed;
    top: 22px;
    right: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.ctrl-btn {
    --size: 72px;
    width: var(--size);
    height: var(--size);
    padding: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(11, 22, 40, 0.35), inset 0 -6px 18px rgba(255, 255, 255, 0.03);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(4px);
}

.ctrl-icon {
    font-size: 20px;
    line-height: 1;
}

.ctrl-label {
    font-size: 11px;
    opacity: 0.95;
}

.ctrl-btn:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 30px rgba(11, 22, 40, 0.45);
}

.ctrl-btn:active {
    transform: translateY(-2px) scale(0.99);
}

.ctrl-btn:focus {
    outline: 3px solid rgba(99, 102, 241, 0.18);
    outline-offset: 3px;
}

/* Color variants */
#resumeButton {
    background: linear-gradient(135deg, #10b981, #06b6d4);
}

#pauseButton {
    background: linear-gradient(135deg, #f97316, #ef4444);
}

#replayButton {
    background: linear-gradient(135deg, #60a5fa, #7c3aed);
}

/* Small-screen adjustments */
@media (max-width: 520px) {
    .ctrl-btn {
        --size: 60px;
    }

    .ctrl-label {
        display: none;
    }
}

/* Home button (top-left) */
.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(11, 22, 40, 0.25);
    text-decoration: none;
    color: #111;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(11, 22, 40, 0.32);
}

.home-btn:focus {
    outline: 3px solid rgba(59, 130, 246, 0.18);
    outline-offset: 3px
}

.home-icon {
    font-size: 20px
}
