@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    background-color: #000;
    font-family: 'Press Start 2P', cursive;
    color: #33ff33;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background-color: #000;
    box-shadow: 0 0 20px rgba(51, 255, 51, 0.2);
    overflow: hidden;
    border: 10px solid #333;
}

/* CRT Scanline Effect */
#game-container::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* HUD */
#hud {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
    z-index: 10; /* Berada di atas aim-container (z-index 5) */
}

.hud-item {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border: 4px solid #33ff33;
    color: #33ff33;
    font-size: 0.7rem;
    text-shadow: 2px 2px #000;
}

.btn-retro {
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    pointer-events: auto; /* Penting agar bisa diklik */
    transition: all 0.1s;
}

.btn-retro:hover {
    background: #33ff33;
    color: #000;
}

.btn-retro:active {
    transform: scale(0.95);
}

/* Result Banner */
#result-banner {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    text-align: center;
    z-index: 10;
}

#result-banner.show {
    transform: translate(-50%, -50%) scale(1);
}

#result-text {
    font-size: 3rem;
    color: #ffff33;
    text-shadow: 4px 4px #c0392b;
    margin-bottom: 10px;
}

#result-subtext {
    font-size: 0.8rem;
    color: #fff;
    background: #000;
    padding: 5px;
}

/* Game Over */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    pointer-events: auto;
}

.game-over-content {
    background: #000;
    padding: 40px;
    border: 6px double #33ff33;
    text-align: center;
}

.game-over-content h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #33ff33;
}

#final-score {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

#star-rating {
    font-size: 2rem;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 10px gold);
}

#retry-btn {
    background: #33ff33;
    color: #000;
    border: none;
    padding: 15px 30px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 6px 6px #006600;
}

#retry-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px #006600;
}

#swipe-instruction {
    position: absolute;
    bottom: 40px;
    width: 100%;
    text-align: center;
    font-size: 0.6rem;
    color: #33ff33;
    text-shadow: 2px 2px #000;
}

#aim-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    z-index: 5;
}

#aim-indicator {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 4px solid rgba(51, 255, 51, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 15px rgba(51, 255, 51, 0.3);
}

.hidden {
    display: none !important;
}

/* Hapus #shoot-btn */

/* Mobile Responsiveness */
@media (max-width: 850px) {
    #game-container {
        width: 100vw;
        height: 100vh;
    }
}
