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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', sans-serif;
    cursor: crosshair;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

#hud {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    z-index: 10;
    pointer-events: none;
}

#health-bar, #xp-bar {
    position: relative;
    width: 180px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #c0392b, #e74c3c);
    transition: width 0.3s;
}

#xp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #2980b9, #3498db);
    transition: width 0.3s;
}

#health-text, #xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

#weapon-slot {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#weapon-name {
    color: #c0a060;
    font-size: 12px;
    font-weight: bold;
}

#damage-numbers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

.damage-number {
    position: absolute;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    animation: floatUp 1s ease-out forwards;
    pointer-events: none;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

#title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(20,0,0,0.8), rgba(0,0,0,0.95));
    z-index: 100;
    cursor: pointer;
}

#title-screen h1 {
    font-size: 64px;
    color: #e8d5a3;
    text-shadow: 0 0 20px rgba(200, 160, 60, 0.5), 2px 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 6px;
    margin-bottom: 30px;
}

#title-screen p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

#stage-name {
    color: #e8d5a3;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

#level-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#level-transition.active {
    opacity: 1;
    pointer-events: auto;
}

#transition-text {
    font-size: 42px;
    color: #e8d5a3;
    text-shadow: 0 0 20px rgba(200, 160, 60, 0.5), 2px 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 4px;
    text-align: center;
}

#portal-hint {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: #88ff88;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(100, 255, 100, 0.5);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 15;
}

#portal-hint.visible {
    opacity: 1;
}

#death-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(30, 0, 0, 0.9);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s;
    cursor: pointer;
}

#death-screen.active {
    opacity: 1;
    pointer-events: auto;
}

#death-screen h2 {
    font-size: 56px;
    color: #cc2222;
    text-shadow: 0 0 30px rgba(200, 0, 0, 0.6), 2px 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 6px;
    margin-bottom: 24px;
}

#death-screen p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
    animation: pulse 2s ease-in-out infinite;
}
