* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e100ff;
    --secondary: #00ffff;
    --accent: #b17df7;
    --hud-bg: rgba(20, 10, 35, 0.65);
    --border-glow: rgba(177, 125, 247, 0.3);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at center, #1b0b2e 0%, #0d0517 60%, #000000 100%);
    font-family: var(--font-body);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: none;
}

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

#hud {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.hud-card {
    background: var(--hud-bg);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 10px 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(177, 125, 247, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#score {
    font-family: var(--font-display);
    font-size: clamp(14px, 4vw, 18px);
    color: #ffffff;
    text-shadow: 0 0 8px var(--accent);
    font-weight: 700;
    letter-spacing: 1.5px;
}

#velocity {
    font-family: var(--font-display);
    font-size: clamp(11px, 3vw, 13px);
    color: var(--secondary);
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 1px;
}

#hook-status {
    font-family: var(--font-display);
    font-size: clamp(10px, 3vw, 12px);
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.status-out {
    background: rgba(255, 20, 80, 0.15);
    color: #ff2a5f;
    border-color: rgba(255, 42, 95, 0.3) !important;
    box-shadow: 0 0 10px rgba(255, 42, 95, 0.2);
    animation: status-pulse-red 2s infinite ease-in-out;
}

.status-ready {
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
    border-color: rgba(255, 170, 0, 0.3) !important;
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}

.status-latched {
    background: rgba(225, 0, 255, 0.15);
    color: var(--primary);
    border-color: rgba(225, 0, 255, 0.4) !important;
    box-shadow: 0 0 15px rgba(225, 0, 255, 0.4);
}

@keyframes status-pulse-red {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; box-shadow: 0 0 15px rgba(255, 42, 95, 0.4); }
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 5, 20, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 20px;
}

#overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#title {
    font-family: var(--font-display);
    font-size: clamp(32px, 8vw, 64px);
    color: #ffffff;
    text-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary);
    margin-bottom: 20px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 900;
    animation: title-glow 3s infinite ease-in-out;
}

@keyframes title-glow {
    0%, 100% { text-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary); }
    50% { text-shadow: 0 0 25px var(--primary), 0 0 45px var(--primary), 0 0 60px var(--secondary); }
}

#instructions {
    font-size: clamp(14px, 4vw, 18px);
    color: #e0d4f5;
    margin-bottom: 30px;
    line-height: 1.6;
    max-width: 500px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

#final-score {
    font-family: var(--font-display);
    font-size: clamp(20px, 5vw, 32px);
    color: var(--secondary);
    margin-bottom: 35px;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
    font-weight: 700;
}

#final-score.hidden {
    display: none;
}

button {
    font-family: var(--font-display);
    padding: clamp(12px, 3vw, 16px) clamp(30px, 8vw, 45px);
    font-size: clamp(15px, 4vw, 18px);
    background: transparent;
    color: #ffffff;
    border: 2px solid var(--primary);
    border-radius: 30px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    box-shadow: 0 0 15px rgba(225, 0, 255, 0.3) inset, 0 0 15px rgba(225, 0, 255, 0.3);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

@media (hover: hover) {
    button:hover {
        background: var(--primary);
        color: #0d0517;
        box-shadow: 0 0 25px var(--primary);
        transform: translateY(-2px);
    }
}

button:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px var(--primary);
}
