:root {
    --bg-dark: #0f0c29;
    --bg-mid: #302b63;
    --bg-light: #24243e;
    --accent-glow: #00f2fe;
    --accent-pink: #ff0844;
    --text-main: #ffffff;
    --text-dim: #b0c4de;
    --glass-bg: rgba(20, 20, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-mid), var(--bg-light));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.9);
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
    z-index: 10;
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    max-width: 450px;
    width: 90%;
}

.hero-icon {
    font-size: 64px;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 0px 20px rgba(0, 242, 254, 0.3);
}

p {
    color: var(--text-dim);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

input {
    width: 100%;
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
    color: white;
    font-size: 1.1rem;
    font-family: 'Nunito', sans-serif;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus {
    border-color: var(--accent-glow);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    outline: none;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.6);
}

.btn.secondary {
    background: transparent;
    border: 2px solid var(--glass-border);
    color: var(--text-main);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* HUD */
.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    pointer-events: none;
}

.player-info, .stats {
    display: flex;
    gap: 15px;
}

.player-info {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    align-items: center;
    font-weight: bold;
    pointer-events: auto;
}

.player-info .avatar {
    font-size: 1.5rem;
    margin-right: 10px;
}

.stat-box {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    font-weight: bold;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    pointer-events: auto;
}

.stat-box .icon {
    margin-right: 8px;
}

.level-box {
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 8, 68, 0.4);
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    cursor: crosshair;
}

.instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    padding: 10px 25px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    z-index: 20;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.8);
}

.score-display {
    font-size: 1.2rem;
    margin: 20px 0;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.score-display span {
    font-weight: bold;
    color: var(--accent-glow);
    font-size: 1.5rem;
}
