:root {
    --primary: #4ade80;
    --primary-dark: #22c55e;
    --secondary: #fbbf24;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    background-color: #1e293b;
    display: block;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

/* Top Bar & Exp Bar */
#top-bar {
    padding: 20px;
    width: 100%;
    z-index: 10;
}

#exp-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    margin-bottom: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#exp-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #2dd4bf);
    transition: width 0.3s ease-out;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.5);
}

#stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.2rem;
}

.stat-item span {
    color: var(--secondary);
}

/* Modals & Screens */
.hidden {
    display: none !important;
}

#start-screen, #skill-selection, #game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: auto;
}

.start-modal, .skill-modal, .game-over-modal {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

h2 {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 10px;
}

.controls-guide {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    font-size: 0.9rem;
    color: #94a3b8;
}

button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.4);
    font-family: 'Black Han Sans', sans-serif;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(34, 197, 94, 0.5);
}

button:active {
    transform: translateY(0);
}

/* Skill Options */
#skill-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.skill-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 15px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.skill-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: scale(1.02);
}

.skill-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-dark);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.skill-info h3 {
    font-size: 1.1rem;
    color: var(--text);
}

.skill-info p {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Joystick */
#joystick-container {
    position: absolute;
    bottom: 50px;
    left: 50px;
    width: 150px;
    height: 150px;
    pointer-events: auto;
    opacity: 0.5;
    transition: opacity 0.3s;
}

#joystick-container:active {
    opacity: 0.8;
}

#joystick-base {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#joystick-stick {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    #joystick-container {
        bottom: 30px;
        left: 30px;
        width: 120px;
        height: 120px;
    }
    #joystick-stick {
        width: 50px;
        height: 50px;
    }
}
