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

body {
    overflow: hidden;
    background: #1a1a2e;
    font-family: 'Segoe UI', system-ui, sans-serif;
    user-select: none;
    cursor: default;
}

#game-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
}

#game-container canvas {
    display: block;
    width: 100%; height: 100%;
}

/* HUD */
#hud {
    position: fixed;
    top: 12px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 8px 24px;
    border-radius: 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
}

#hud-coins { color: #ffd700; }
#hud-day { color: #a8e6cf; }
#hud-time { color: #dcedc1; }

/* Tool label */
#tool-label {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 13px;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Hotbar */
#hotbar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    padding: 6px;
    border-radius: 12px;
    z-index: 10;
}

.hotbar-slot {
    width: 54px; height: 54px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}

.hotbar-slot:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.hotbar-slot.selected {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.hotbar-slot.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.hotbar-icon {
    width: 32px; height: 32px;
    image-rendering: pixelated;
}

.hotbar-qty {
    position: absolute;
    bottom: 2px; right: 4px;
    font-size: 11px;
    color: #fff;
    font-weight: 700;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

.hotbar-key {
    position: absolute;
    top: 1px; left: 4px;
    font-size: 9px;
    color: rgba(255,255,255,0.5);
}

/* Tooltip */
#tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    z-index: 20;
    display: none;
    white-space: nowrap;
}

/* Overlays */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay.hidden { display: none; }

.overlay-panel {
    background: #2a2a3e;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 24px;
    min-width: 320px;
    max-width: 480px;
    color: #fff;
}

.overlay-panel h2 {
    text-align: center;
    margin-bottom: 16px;
    font-size: 22px;
    color: #ffd700;
}

.shop-item, .market-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.shop-item:hover, .market-item:hover {
    background: rgba(255, 255, 255, 0.16);
}

.shop-item.cant-afford {
    opacity: 0.4;
    cursor: not-allowed;
}

.item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-icon {
    width: 32px; height: 32px;
    image-rendering: pixelated;
}

.item-name { font-weight: 600; }
.item-price { color: #ffd700; font-weight: 600; }
.item-qty { color: #a8e6cf; font-size: 13px; }

.close-btn {
    display: block;
    margin: 16px auto 0;
    padding: 8px 32px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Notification */
#notification {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #a8e6cf;
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

#notification.show {
    opacity: 1;
}

/* Barn overlay */
.barn-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.barn-qty { color: #c8a86e; }
.inv-qty { color: #a8e6cf; }

.barn-actions {
    display: flex;
    gap: 6px;
}

.barn-btn {
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    background: rgba(255, 255, 255, 0.1);
}

.barn-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.deposit-btn { border-color: #a8e6cf; color: #a8e6cf; }
.withdraw-btn { border-color: #ffd700; color: #ffd700; }

.capacity-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, #a8e6cf, #ffd700);
    border-radius: 4px;
    transition: width 0.3s;
}

.capacity-text {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}

.action-btn {
    display: block;
    width: 100%;
    margin: 12px 0 4px;
    padding: 8px 16px;
    background: rgba(168, 230, 207, 0.15);
    border: 1px solid #a8e6cf;
    border-radius: 8px;
    color: #a8e6cf;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.action-btn:hover {
    background: rgba(168, 230, 207, 0.3);
}

/* Tile hover highlight (done via Three.js, not CSS) */
