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

body {
    background-color: #000;
    color: #fff;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

canvas {
    position: absolute;
    cursor: crosshair;
}

/* ---- HUD ---- */

#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    list-style: none;
    z-index: 10;
    display: flex;
    gap: 20px;
    font-size: 12px;
    letter-spacing: 1px;
}

#hud li {
    white-space: nowrap;
}

#combo {
    color: #ff0;
}

#lives {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    font-size: 14px;
    letter-spacing: 4px;
}

/* ---- OVERLAYS ---- */

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.85);
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 28px;
    letter-spacing: 4px;
    margin-bottom: 20px;
    font-weight: normal;
}

.overlay p {
    font-size: 13px;
    margin: 3px 0;
    letter-spacing: 1px;
}

.overlay a {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.back-btn {
    margin-top: 30px;
    font-size: 14px;
    letter-spacing: 2px;
    border: 1px solid #555;
    padding: 8px 24px;
    transition: border-color 0.2s;
}

.back-btn:hover {
    border-color: #fff;
}

/* ---- MAIN MENU ---- */

#menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.9);
}

#menu.hidden {
    display: none;
}

#title {
    font-size: 48px;
    letter-spacing: 12px;
    margin-bottom: 10px;
    font-weight: normal;
}

#message {
    font-size: 12px;
    letter-spacing: 3px;
    margin-bottom: 40px;
    color: #888;
}

#start {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 4px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #555;
    padding: 10px 40px;
    transition: border-color 0.2s;
}

#start:hover {
    border-color: #fff;
}

#menu-links {
    margin-top: 30px;
    display: flex;
    gap: 30px;
}

#menu-links a {
    font-size: 11px;
    letter-spacing: 2px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

#menu-links a:hover {
    color: #fff;
}

/* ---- HOW TO PLAY ---- */

.howto-content {
    text-align: center;
    line-height: 1.8;
}

.howto-content b {
    color: #aaa;
}

/* ---- CREDITS ---- */

.credits-content {
    text-align: center;
    line-height: 1.8;
}

#credits-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #555;
    margin-bottom: 15px;
}

.credits-name {
    font-size: 16px !important;
    letter-spacing: 2px;
}

.credits-course {
    font-size: 14px !important;
    letter-spacing: 1px;
}

.credits-support a {
    color: #888;
    border: 1px solid #444;
    padding: 5px 15px;
    font-size: 11px;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.credits-support a:hover {
    color: #fff;
    border-color: #fff;
}

/* ---- SHOP ---- */

#shop h2 {
    font-size: 20px;
    margin-bottom: 30px;
}

#shop-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.shop-card {
    border: 1px solid #555;
    padding: 20px;
    width: 180px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.shop-card:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.shop-card.cursed {
    border-color: #ff3366;
    color: #ff99aa;
    text-shadow: 0 0 5px rgba(255, 51, 102, 0.5);
}
.shop-card.cursed:hover {
    border-color: #ff6699;
    background: rgba(255, 51, 102, 0.1);
    transform: scale(1.05);
}

.shop-card .card-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.shop-card .card-name {
    font-size: 13px;
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-family: 'Courier New', Courier, monospace;
}

.shop-card .card-desc {
    font-size: 10px;
    color: #888;
    line-height: 1.5;
    font-family: 'Courier New', Courier, monospace;
}

/* ---- WAVE CLEAR ---- */

#wave-clear h2 {
    font-size: 36px;
    letter-spacing: 6px;
}

#wave-clear-score {
    font-size: 14px;
    color: #888;
    margin-top: 5px;
}

/* ---- GAME OVER ---- */

#gameover h2 {
    font-size: 36px;
    letter-spacing: 6px;
    margin-bottom: 20px;
}

#gameover p {
    margin: 5px 0;
}

#final-score {
    font-size: 18px !important;
}

#high-score {
    color: #888;
    margin-top: 5px !important;
}

#restart-btn {
    display: inline-block;
    margin-top: 25px;
    font-size: 16px;
    letter-spacing: 3px;
    border: 1px solid #555;
    padding: 8px 30px;
    transition: border-color 0.2s;
}

#restart-btn:hover {
    border-color: #fff;
}

#gameover-links {
    margin-top: 20px;
    display: flex;
    gap: 25px;
}

#gameover-links a {
    font-size: 11px;
    letter-spacing: 2px;
    color: #666;
    transition: color 0.2s;
}

#gameover-links a:hover {
    color: #fff;
}

/* ---- BOSS WARNING ---- */

.boss-text {
    animation: bossFlash 0.3s ease-in-out infinite alternate;
}

@keyframes bossFlash {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* ---- BOSS HP BAR ---- */

#boss-hp-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

#boss-hp-container.hidden {
    display: none;
}

#boss-hp-label {
    font-size: 10px;
    letter-spacing: 3px;
    margin-bottom: 4px;
    color: #888;
}

#boss-hp-bar-bg {
    width: 200px;
    height: 3px;
    background: #333;
}

#boss-hp-bar {
    width: 100%;
    height: 100%;
    background: #fff;
    transition: width 0.15s;
}

/* ---- MOBILE TOUCH CONTROLS ---- */

#touch-left, #touch-right {
    position: absolute;
    bottom: 0;
    width: 50%;
    height: 100%;
    z-index: 5;
    pointer-events: auto;
}

#touch-left {
    left: 0;
}

#touch-right {
    right: 0;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 600px) {
    #title {
        font-size: 28px;
        letter-spacing: 6px;
    }

    #message {
        font-size: 10px;
    }

    #start {
        font-size: 14px;
        padding: 8px 30px;
    }

    .overlay h2 {
        font-size: 20px;
    }

    .shop-card {
        width: 140px;
        padding: 15px;
    }

    .shop-card .card-icon {
        font-size: 22px;
    }

    .shop-card .card-name {
        font-size: 11px;
    }

    #hud {
        font-size: 10px;
        gap: 12px;
    }

    #boss-hp-bar-bg {
        width: 140px;
    }
}
