body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #222;
}

#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#header {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
    border-bottom: 2px solid #ffaa00;
}

.title-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

h1 {
    margin: 0;
    font-size: 24px;
    color: #ffaa00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#level-badge {
    background: linear-gradient(135deg, #ffcc00, #ff8800);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid #fff;
    text-shadow: 1px 1px 2px #000;
}

#stats-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

#xp-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
}

.xp-bar-bg {
    width: 150px;
    height: 15px;
    background: #444;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #777;
}

#xp-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%);
    transition: width 0.3s ease-out;
}

#inventory {
    font-size: 18px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    background: rgba(255, 68, 68, 0.9);
    padding: 5px 12px;
    border-radius: 20px;
    border: 2px solid white;
}

#coins {
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
    display: flex;
    align-items: center;
    background: rgba(255, 215, 0, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    border: 2px solid #ffd700;
}

#messages {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: opacity 0.5s;
    pointer-events: auto;
    border-bottom: 4px solid #ffaa00;
}

#controls-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #ddd;
    text-align: center;
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 20px;
    pointer-events: auto;
}

#reset-cam {
    background: #ff5500;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    margin-right: 10px;
    font-family: inherit;
    font-weight: bold;
}

#reset-cam:hover {
    background: #ff7700;
}

#shop-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 5px solid #4CAF50;
    min-width: 200px;
}

#shop-panel h3 {
    margin: 0 0 10px 0;
    color: #333;
    text-align: center;
}

.shop-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s, transform 0.1s;
}

.shop-btn:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
}

.shop-btn:disabled {
    background: #aaa;
    cursor: not-allowed;
    color: #eee;
}

#game-container {
    width: 100%;
    height: 100%;
}

.floating-text {
    position: absolute;
    color: #4CAF50;
    font-weight: bold;
    font-size: 28px;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    pointer-events: none;
    animation: floatUp 1.5s ease-out forwards;
    z-index: 100;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateY(-40px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(-80px) scale(1);
        opacity: 0;
    }
}

#level-up-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 60px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px #ffea00, 0 0 30px #ffea00, 4px 4px 0px #000;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s;
    z-index: 1000;
}

#level-up-screen.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}