@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

body {
    background-color: #0d0914;
    background-image: 
        radial-gradient(circle, rgba(157, 78, 221, 0.1) 1px, transparent 1px),
        radial-gradient(circle, rgba(123, 44, 191, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    color: #f8f9fa;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    animation: scrollBg 20s linear infinite;
}

@keyframes scrollBg {
    from { background-position: 0 0, 20px 20px; }
    to { background-position: 0 40px, 20px 60px; }
}

#game-wrapper {
    position: relative;
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(157, 78, 221, 0.1);
    background: #1a1325;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

#hud {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 20px;
    font-size: 1.2rem;
    color: #e0aaff;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
    box-sizing: border-box;
    pointer-events: none;
}

#overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(13, 9, 20, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.title {
    font-size: 3rem;
    color: transparent;
    background: linear-gradient(90deg, #e0aaff, #9d4edd);
    -webkit-background-clip: text;
    background-clip: text;
    margin: 0 0 10px 0;
    letter-spacing: -1px;
}

#overlay p {
    font-size: 1.2rem;
    color: #adb5bd;
    font-weight: 300;
    margin-bottom: 30px;
}

.controls {
    font-size: 0.9rem;
    color: #f8f9fa;
    background: rgba(157, 78, 221, 0.1);
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid rgba(157, 78, 221, 0.3);
}

.back {
    margin-top: 30px;
    color: #f8f9fa;
    font-size: 1rem;
    text-decoration: none;
    background: #261c36;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back:hover {
    background: rgba(157, 78, 221, 0.1);
    border-color: #9d4edd;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
    transform: translateY(-2px);
}

/* Mobile Controls */
.virtual-controls { display: none; flex-direction: column; align-items: center; gap: 10px; margin-top: 20px; z-index: 999; position: relative; }
.v-row { display: flex; gap: 10px; }
.v-btn { width: 50px; height: 50px; background: rgba(157, 78, 221, 0.2); border: 2px solid #9d4edd; color: #fff; font-size: 20px; border-radius: 8px; user-select: none; touch-action: none; display: flex; justify-content: center; align-items: center; cursor: pointer; }
.v-btn:active { background: rgba(157, 78, 221, 0.6); }
.action-btn { background: rgba(224, 170, 255, 0.2); border-color: #e0aaff; border-radius: 50%; }
@media (max-width: 768px) {
    .virtual-controls { display: flex; }
    #game-wrapper, #game-container { flex-direction: column; }
}
