*{
    cursor: none;
}

body{
    margin: 0;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    user-select: none;
    touch-action: none; 
    -ms-touch-action: none;
    background-color: black;
    cursor: none;
}
canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;    
}

#ui-layer{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
} 
.inventory .slot, 
.construction-bar,
.btn-map {
    pointer-events: auto;
}

/*
/  GAME HUD STYLES
*/


/* STATUS BAR */
.stats-bar{
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bar-container{
    width: 300px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid white;
    position: relative;
}
.bar-fill{
    height: 100%;
    width: 100%;
    transition: width 0.2s, background-color 0.2s;
}

.bar-fill.health{
    background-color: #ff4d4d;
}
.bar-fill.shield{
    background-color: #4da6ff;
}

.bar-container span{
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    font-size: 14px;
}

.bottom-center{
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.inventory{
    display: flex;
    gap: 5px;
    background-color: rgba(80, 80, 80, 0.6);
    padding: 5px;
    border: 2px solid white;
}
.slot{
    width: 60px;
    height: 60px;
    background-color: rgba(100, 100, 100, 0.8);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.1s;
}
.slot:hover{
    background-color: rgba(150, 150, 150, 1);
}
.slot:active{
    background-color: rgba(50, 50, 50, 1);
}
.slot img{
    max-width: 80%;
    max-height: 80%;
    pointer-events: none;
}

.construction-bar{
    width: auto;
    height: 80px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: white;
}

.construction-action {
    position: relative;
}

.construction-action:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; 
    left: 50%;
    transform: translateX(-50%); 
    background-color: #222;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px; 
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap; 
    text-transform: capitalize; 
    z-index: 100;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.5);
    pointer-events: none; 
    opacity: 0;
    transition: opacity 0.2s, bottom 0.2s;
}

.construction-action:hover::before {
    content: '';
    position: absolute;
    bottom: 100%; 
    left: 50%;
    transform: translateX(-50%);
    
    border-width: 6px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
    
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s, bottom 0.2s;
}

.construction-action:hover::after,
.construction-action:hover::before {
    opacity: 1;
    bottom: 125%; 
}
.construction-action:hover::before {
    bottom: 110%; 
}

.bottom-right{
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.minimap-container {
    width: 150px;
    height: 150px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid white;
    position: relative;
    overflow: hidden;
}
#minimap-player {
    width: 6px;
    height: 6px;
    background-color: yellow;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.map-buttons{
    display: flex;
    gap: 5px;
}
.btn-map{
    width: 47px;
    height: 47px;
    border: 2px solid white;
    color: white;
    font-weight: bold;
    font-size: 10px;
    cursor: pointer;
}
.btn-map.shop{
    background-color: rgba(0, 128, 0, 0.6);
}
.btn-map.help{
    background-color: rgba(128, 0, 0, 0.6);
}
.resources{
    top: 20px;
    right: 20px;
    width: 250px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid white;
    color: white;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: start;
}
.resources-amount{
    float: right;
}
.modal {
    position: fixed;
    top: 100px; 
    left: 20px;
    
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid white;
    color: white;
    padding: 0; 
    z-index: 1000;
    display: none;
    flex-direction: column;
    
    pointer-events: auto;
    
    box-shadow: 0px 0px 10px rgba(0,0,0,0.5);
    min-width: 300px;
    cursor: auto;
}

.modal * {
    cursor: auto;
}

.modal-header {
    background-color: #333;
    padding: 10px;
    cursor: grab; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
    font-weight: bold;
    color: #ffcc00;
}

.modal-header:active {
    cursor: grabbing;
}

.modal-content {
    padding: 20px;
}

.modal.shop {
    min-width: 1000px;
    max-width: 1200px;
    max-height: 600px;
}

.shop-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 450px;
    overflow-y: auto;
}

.hud-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    width: 100%;
}

.hud-shop-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    background: rgba(32, 32, 32, 0.9);
    border: 1px solid #3d3d3d;
    color: #f0f0f0;
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hud-shop-item:hover {
    transform: translateY(-2px);
    border-color: #ffb347;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.hud-shop-item strong {
    font-size: 15px;
    letter-spacing: 0.4px;
}

.hud-shop-item-tier {
    font-size: 12px;
    color: #ffc04c;
}

.hud-shop-item-gold {
    font-size: 12px;
    color: #ffe28f;
}

.hud-shop-item-stats,
.hud-shop-item-description {
    font-size: 12px;
    color: #d0d0d0;
    line-height: 1.4;
}

.hud-shop-item-coming-soon {
    color: #9e9e9e;
    font-style: italic;
}

.hud-shop-item.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.hud-shop-item.is-social a {
    color: #76c7ff;
    text-decoration: none;
    font-weight: bold;
}

.hud-shop-item.is-social a:hover {
    text-decoration: underline;
}

.tab-bar {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 12px;
    background: rgba(28, 28, 28, 0.8);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #3a3a3a;
}

.tab-link {
    background: transparent;
    color: #cfcfcf;
    border: 1px solid transparent;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-link.is-active {
    background: linear-gradient(135deg, #4ac5ff, #4781ff);
    border-color: #4ac5ff;
    color: #0c1024;
}

.tab-panels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tab-panel {
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid #2e2e2e;
    border-radius: 12px;
    padding: 12px;
}


.pill-btn {
    background: linear-gradient(135deg, #52d67a, #2fb95a);
    color: #0d1b0f;
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.pill-btn:hover {
    opacity: 0.9;
}

.close-btn {
    cursor: pointer;
    background: #c80000;
    border: none;
    color: white;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
}

.shop-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 360px;
}

.shop-section h4 {
    margin: 0 0 8px 0;
    color: #ffd700;
}

.shop-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.shop-item {
    background: rgba(40, 40, 40, 0.8);
    color: #f5f5f5;
    border: 2px solid #555;
    border-radius: 8px;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease;
}

.shop-item:hover {
    transform: translateY(-2px);
    background: rgba(60, 60, 60, 0.9);
}

.shop-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.shop-meta {
    font-size: 12px;
    color: #bfbfbf;
}

.shop-hint {
    font-size: 12px;
    color: #c0c0c0;
    opacity: 0.8;
}


#suggestion-status {
    font-size: 12px;
    min-height: 16px;
}

/* TOAST */
.toast{
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background-color: rgba(0, 0, 0, 1);
    color: white;
    padding: 20px 40px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    font-weight: bold;
    z-index: 10000;
    pointer-events: none;
    border: 3px solid white;
    min-width: 300px;
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
}
.toast-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast-info {
    border-color: #3498db;
    background: rgba(52, 152, 219, 1);
}

.toast-success {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 1);
}

.toast-warning {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 1);
}

.toast-error {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 1);
}
.day-night-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid white;
    padding: 8px 12px;
    width: 200px;
    pointer-events: none;
    z-index: 50;
}

.day-night-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.day-night-label {
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px black;
}

.day-night-timer {
    font-size: 12px;
    color: white;
    font-weight: bold;
}

.day-night-progress-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(50, 50, 50, 0.8);
    position: relative;
    overflow: hidden;
}

.day-night-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    transition: width 1s linear, background-color 0.3s;
}

.day-night-progress-fill.day {
    background-color: #FFD700;
}

.day-night-progress-fill.night {
    background-color: #4a5568;
}

.day-night-icon {
    font-size: 24px;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.day-night-text {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.day-night-wave {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    pointer-events: auto;
    transition: background-color 0.5s ease;
}

.game-over-screen.show {
    background-color: rgba(0, 0, 0, 0.85);
}

.game-over-content {
    background-color: rgba(20, 20, 20, 0.95);
    border: 4px solid white;
    padding: 40px 60px;
    text-align: center;
    transform: scale(0.7);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.game-over-screen.show .game-over-content {
    transform: scale(1);
    opacity: 1;
}

.game-over-title {
    font-size: 72px;
    font-weight: bold;
    color: #2fb95a;
    margin: 0 0 20px 0;
    letter-spacing: 8px;
    font-family: 'Courier New', Courier, monospace;
}

.game-over-reason {
    font-size: 20px;
    color: white;
    margin: 0 0 40px 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Courier New', Courier, monospace;
}

.game-over-restart {
    background-color: rgba(40, 40, 40, 0.9);
    color: white;
    border: 3px solid white;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 2px black;
    letter-spacing: 2px;
}

.game-over-restart:hover {
    background-color: rgba(100, 100, 100, 0.9);
    border-color: #2fb95a;
    color: #2fb95a;
    transform: translateY(-2px);
}

.game-over-restart:active {
    transform: translateY(0px);
}