body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #1a1a2e;
    font-family: 'Courier New', Courier, monospace;
    color: #e94560;
    user-select: none;
    touch-action: none;
}

#gameCanvas {
    display: block;
    background-color: #16213e;
}

#ui-container {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    pointer-events: none;
    z-index: 10;
}

#top-bar {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 24px;
    text-shadow: 2px 2px 0px #000;
}

#score-board {
    color: #fca311;
}

#high-score {
    color: #00fff5;
}

#level-display {
    text-align: center;
    font-size: 20px;
    color: #fff;
    font-weight: bold;
    margin-top: 5px;
    text-shadow: 2px 2px 0px #000;
}

#health-display {
    font-size: 24px;
    margin-top: 5px;
    text-shadow: 2px 2px 0px #000;
}

/* Action Bars */
#dash-container,
#fire-container {
    width: 150px;
    height: 10px;
    background: #333;
    border: 1px solid #fff;
    margin-top: 10px;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
}

#dash-bar {
    width: 100%;
    height: 100%;
    background: #00ff00;
    transform-origin: left;
    transform: scaleX(1);
}

#dash-text {
    position: absolute;
    top: 12px;
    left: 0;
    font-size: 10px;
    color: #fff;
}

#fire-container {
    margin-top: 25px;
}

/* Offset below dash */
#fire-bar {
    width: 100%;
    height: 100%;
    background: #ff4500;
    transform-origin: left;
    transform: scaleX(1);
}

#fire-text {
    position: absolute;
    top: 12px;
    left: 0;
    font-size: 10px;
    color: #fff;
}

#combo-display {
    position: absolute;
    top: 150px;
    left: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px #ff4500;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

/* Floating Text */
#floating-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-text {
    position: absolute;
    font-weight: bold;
    font-size: 20px;
    text-shadow: 1px 1px 0 #000;
    animation: floatUp 1s forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.5);
    }
}

/* Notifications */
#achievement-popup {
    position: absolute;
    top: 100px;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border-left: 4px solid #fca311;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 250px;
    transform: translateX(100%);
    transition: transform 0.5s ease-out;
    pointer-events: none;
}

#achievement-popup.show {
    transform: translateX(0);
}

#ach-icon {
    font-size: 30px;
}

#ach-text {
    display: flex;
    flex-direction: column;
}

#ach-title {
    color: #fca311;
    font-weight: bold;
    font-size: 16px;
}

#ach-desc {
    color: #fff;
    font-size: 12px;
}

/* Transition Overlay */
#transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s;
    opacity: 1;
    pointer-events: none;
}

#transition-overlay.hidden {
    opacity: 0;
}

#transition-text {
    color: #fff;
    font-size: 48px;
}

/* Controls */
#controls-hint {
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.7;
    color: #fff;
}

#mobile-controls {
    position: absolute;
    bottom: 40px;
    width: 100%;
    height: 150px;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
    z-index: 5;
}

.joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    pointer-events: auto;
}

.joystick-stick {
    width: 50px;
    height: 50px;
    background: rgba(233, 69, 96, 0.5);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#dash-btn-mobile {
    pointer-events: auto;
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 0, 0.3);
    border: 2px solid #00ff00;
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

#dash-btn-mobile:active {
    background: rgba(0, 255, 0, 0.6);
}

#fire-btn-mobile {
    pointer-events: auto;
    width: 60px;
    height: 60px;
    background: rgba(255, 69, 0, 0.3);
    border: 2px solid #ff4500;
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

#fire-btn-mobile:active {
    background: rgba(255, 69, 0, 0.6);
}

#pause-btn-mobile {
    pointer-events: auto;
    position: absolute;
    top: -450px;
    right: -20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid #fff;
    border-radius: 5px;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Menus */
#pause-menu,
#game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.95);
    padding: 30px;
    border: 4px solid #e94560;
    border-radius: 10px;
    z-index: 20;
    min-width: 300px;
}

.hidden {
    display: none;
}

#pause-menu h1,
#game-over-screen h1 {
    font-size: 48px;
    margin: 0 0 20px 0;
    color: #e94560;
}

#pause-menu button,
#game-over-screen button {
    background: #e94560;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    margin-top: 10px;
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

#pause-menu button:hover,
#game-over-screen button:hover {
    background: #ff6b6b;
}

#game-over-screen.victory {
    border-color: #fca311;
}

#game-over-screen.victory h1 {
    color: #fca311;
}

#stats-summary {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin: 15px 0;
    text-align: left;
}

#stats-summary h3 {
    margin: 0 0 10px 0;
    color: #4cc9f0;
    font-size: 16px;
    border-bottom: 1px solid #4cc9f0;
    padding-bottom: 5px;
}

#stats-summary p {
    margin: 5px 0;
    font-size: 14px;
    color: #ddd;
    display: flex;
    justify-content: space-between;
}

#badges-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.badge {
    background: #333;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    color: #aaa;
    border: 1px solid #555;
}

.badge.unlocked {
    background: #fca311;
    color: #000;
    border-color: #fff;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(252, 163, 17, 0.5);
}