* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Prevent browser scrolling on swipe */
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #1a1a2e;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
    background-color: #2c3e50;
    background-image: url('bg2.png');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* No background here, transparent so bg.png shows through */
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let touches pass through to canvas */
}

#score-board {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #ffdb58;
    color: #c0392b;
    padding: 10px 18px;
    border-radius: 15px;
    border: 4px solid #000;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.9);
    transform: rotate(-3deg);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    z-index: 100;
}

.score-text {
    font-size: 24px;
    font-weight: 900;
}

.misses-text {
    font-size: 14px;
    font-weight: 900;
    margin-top: 2px;
    color: #2c3e50;
    letter-spacing: 0.5px;
}

#landscape-warning {
    display: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #1a1a2e;
    color: white;
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

#landscape-warning h2 {
    font-size: 36px;
    color: #e94560;
    margin-bottom: 20px;
}

#landscape-warning p {
    font-size: 24px;
}

@media (orientation: landscape) and (max-height: 600px) {
    #landscape-warning {
        display: flex;
    }
}

.fullscreen-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 200;
    pointer-events: auto; /* Allow clicks on buttons */
}

.fullscreen-overlay h1 {
    font-size: 36px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 #000;
}

.fullscreen-overlay p {
    font-size: 20px;
    margin-bottom: 30px;
}

.fullscreen-overlay button {
    font-family: 'Arial', sans-serif;
    font-size: 24px;
    padding: 10px 30px;
    background-color: #f39c12;
    border: 3px solid #000;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
}

#game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    border: 5px solid #000;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5);
    text-align: center;
    pointer-events: auto; /* Buttons need clicks */
}

#game-over-screen.hidden,
#start-screen.hidden {
    display: none;
}

#game-over-screen h2 {
    font-size: 48px;
    color: #e94560;
    margin-bottom: 20px;
    text-transform: uppercase;
}

#game-over-screen p {
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
}

#restart-btn {
    font-family: 'Arial', sans-serif;
    font-size: 24px;
    padding: 15px 30px;
    background: #f7b733;
    color: #000;
    border: 3px solid #000;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    transition: transform 0.1s;
}

#restart-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 #000;
}

#help-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f1c40f;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    color: #000;
    font-family: 'Arial', sans-serif;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 150;
    transition: transform 0.1s;
}

#help-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

#help-popup.hidden {
    display: none !important;
}

.popup-content {
    background: rgba(255, 255, 255, 0.98);
    padding: 30px;
    border-radius: 20px;
    border: 5px solid #000;
    box-shadow: 8px 8px 0 rgba(0,0,0,0.6);
    text-align: center;
    max-width: 320px;
    width: 80%;
    color: #333;
    pointer-events: auto;
}

.popup-content h2 {
    font-family: 'Arial', sans-serif;
    font-size: 36px;
    color: #e67e22;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.popup-content p {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.popup-content button {
    font-family: 'Arial', sans-serif;
    font-size: 20px;
    padding: 10px 25px;
    background-color: #2ecc71;
    border: 3px solid #000;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
}

