:root {
    --bg-color: #05070a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --text-primary: #ffffff;
    --text-secondary: #64748b;
    --accent-blue: #38bdf8;
    --accent-purple: #818cf8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.05) 0%, transparent 80%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(255,255,255,0.1)' /%3E%3C/svg%3E");
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.header {
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.score-container,
.best-container {
    display: flex;
    flex-direction: column;
}

.label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

#score,
#best {
    font-size: 2.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: transform 0.1s ease-out;
}

#score:hover {
    transform: scale(1.05);
}

@keyframes scorePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: all;
    padding: 2rem;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

h1 {
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom, #fff, #444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.2rem;
    font-weight: 300;
}

.instructions {
    margin-bottom: 4rem;
}

.tutorial-visual {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
}

.planet-mini {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
}

.moon-mini {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    margin-left: 35px;
    margin-top: -5px;
    animation: rotate 3s linear infinite;
    transform-origin: -35px 5px;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

button {
    background: #ffffff;
    color: #000;
    border: none;
    padding: 1.4rem 4rem;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.1);
}

button:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 60px rgba(255, 255, 255, 0.2);
}

button:active {
    transform: translateY(0) scale(0.98);
}

.final-stats {
    display: flex;
    gap: 5rem;
    margin-bottom: 4rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat span:last-child {
    font-size: 3rem;
    font-weight: 800;
}

.mode-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-buttons button {
    min-width: 160px;
}

#survival-button {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
}

#survival-button:hover {
    box-shadow: 0 20px 60px rgba(249, 115, 22, 0.4);
}