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

body {
    overflow: hidden;
    font-family: 'Jua', sans-serif;
    background-color: #000;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
}

/* CROSSHAIR */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2.5rem;
    pointer-events: none;
    z-index: 10;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    display: none;
    /* Only show when playing */
}

/* OVERLAYS */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: #fff;
    text-align: center;
}

.menu-box {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    color: #333;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.menu-box h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.menu-box button {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    padding: 12px 40px;
    margin-top: 25px;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    background: #ff6b6b;
    color: #fff;
    transition: transform 0.2s;
}

.menu-box button:hover {
    transform: scale(1.05);
}

.controls-info {
    text-align: left;
    background: #f1f2f6;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 20px 0;
    color: #555;
    border-left: 5px solid #ff6b6b;
}

/* HUD */
#hud {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 50;
    color: #fff;
}

.status-top {
    position: fixed;
    top: 30px;
    left: 30px;
}

#hp-bar-container {
    width: 250px;
    height: 30px;
    background: #2f3542;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.resource-counter {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.res-item {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 1.2rem;
    color: #fff;
    border-left: 5px solid #ff6b6b;
    width: fit-content;
}

.res-item:nth-child(2) {
    border-left-color: #2ed573;
}

#hp-bar-fill {
    width: 100%;
    height: 100%;
    background: #2ed573;
    transition: width 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#hp-text {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.inventory {
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.inv-slot {
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 25px;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    font-size: 1.5rem;
    transition: 0.2s;
}

.inv-slot.selected {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.3);
    transform: translateY(-5px);
}

/* SHOP */
.shop-box {
    max-width: 650px;
    background: #f1f2f6;
    max-height: 90vh;
    overflow-y: auto;
}

.shop-section {
    margin-top: 25px;
    text-align: left;
}

.shop-section h3 {
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
    color: #2f3542;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.shop-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto;
}

.shop-item:hover {
    transform: translateY(-5px);
    border-color: #ff6b6b;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.2);
}

.item-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.item-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.item-cost {
    color: #57606f;
    font-size: 1rem;
    font-weight: bold;
}

#msg {
    margin-top: 15px;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 15px;
    border-radius: 10px;
}

.hidden {
    display: none !important;
}