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

body {
    font-family: 'Courier New', monospace;
    background-color: #1a1a2e;
    color: #fff;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#ui-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #16213e;
    padding: 10px 20px;
    border-bottom: 3px solid #0f3460;
    z-index: 10;
}

.ui-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.ui-item .label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.ui-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

#game-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

#start-screen,
#gameover-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(26, 26, 46, 0.97);
    z-index: 100;
    text-align: center;
    padding: 20px;
    overflow-y: auto;
}

#start-screen h1 {
    font-size: 42px;
    color: #ffd700;
    text-shadow: 4px 4px 0 #000, 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

#gameover-screen h1 {
    font-size: 48px;
    color: #ff4757;
    text-shadow: 4px 4px 0 #000, 0 0 20px rgba(255, 71, 87, 0.5);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

#start-screen p {
    font-size: 20px;
    color: #888;
    margin-bottom: 30px;
}

.instructions {
    margin-bottom: 30px;
    text-align: left;
    background-color: #16213e;
    padding: 25px 30px;
    border-radius: 15px;
    border: 3px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    max-width: 400px;
}

.instructions-title {
    text-align: center;
    font-size: 22px;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000;
}

.instructions p {
    font-size: 16px;
    margin: 12px 0;
    line-height: 1.8;
}

.instructions .highlight {
    color: #2ed573;
    font-weight: bold;
    font-size: 18px;
}

.instructions .highlight.gold {
    color: #ffd700;
}

.instructions .warning {
    color: #ff4757;
    font-weight: bold;
    font-size: 18px;
}

.instructions .tips {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #0f3460;
    color: #888;
    font-size: 14px;
    text-align: center;
}

button {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    padding: 15px 40px;
    background-color: #e94560;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 #c73e52;
}

button:hover {
    background-color: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #c73e52;
}

button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c73e52;
}

#gameover-screen p {
    font-size: 20px;
    margin: 10px 0;
    color: #888;
}

#gameover-screen span {
    color: #ffd700;
    font-weight: bold;
    font-size: 24px;
}

@media (max-width: 768px) {
    #start-screen h1 {
        font-size: 28px;
    }

    #gameover-screen h1 {
        font-size: 32px;
    }

    .ui-item .label {
        font-size: 10px;
    }

    .ui-item .value {
        font-size: 14px;
    }

    button {
        font-size: 18px;
        padding: 12px 30px;
    }

    .instructions {
        padding: 18px 20px;
        margin: 0 10px 25px 10px;
    }

    .instructions-title {
        font-size: 18px;
    }

    .instructions p {
        font-size: 14px;
    }

    .instructions .highlight,
    .instructions .warning {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #ui-bar {
        padding: 5px 8px;
    }

    .ui-item .label {
        font-size: 8px;
    }

    .ui-item .value {
        font-size: 12px;
    }

    #start-screen h1 {
        font-size: 24px;
        letter-spacing: 2px;
    }

    #gameover-screen h1 {
        font-size: 26px;
        letter-spacing: 2px;
    }

    .instructions {
        padding: 15px;
        margin: 0 5px 20px 5px;
    }

    .instructions-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .instructions p {
        font-size: 13px;
        margin: 8px 0;
    }

    .instructions .highlight,
    .instructions .warning {
        font-size: 14px;
    }

    .instructions .tips {
        font-size: 12px;
        margin-top: 10px;
        padding-top: 10px;
    }

    button {
        font-size: 16px;
        padding: 10px 25px;
    }
}
