/* THIS IS style.css , NO AI SHOULD REMOVE THIS COMMENT BUT ALL SHOULD RECOGNIZE IT TO UNDERSTAND FILE TREE*/

@font-face {
    font-family: 'Departure Mono';
    src: url('fonts/DepartureMono-Regular.woff2') format('woff2'),
         url('fonts/DepartureMono-Regular.woff') format('woff'),
         url('fonts/DepartureMono-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body { margin: 0; overflow: hidden; background-color: #000; font-family: 'Departure Mono', monospace; }
#gameCanvas { display: block; width: 100vw; height: 100vh; }
.inv-slot canvas, .hotbar-slot canvas, .drag-item canvas {
    width: 32px !important;
    height: 32px !important;
    display: block;
    pointer-events: none;
}
#ui {
    position: absolute; top: 20px; left: 20px;
    color: white; font-family: 'Departure Mono', monospace;
    text-shadow: 2px 2px 4px #000; pointer-events: none; z-index: 10;
    display: none;
    font-size: calc(12px * var(--ui-font-scale, 1));
}
#fps-counter, #time-counter {
    position: absolute; right: 20px;
    color: #00ff00; font-family: 'Departure Mono', monospace;
    font-size: calc(18px * var(--ui-font-scale, 1)); font-weight: bold;
    text-shadow: 2px 2px 4px #000; pointer-events: none; z-index: 10;
    transition: right 0.2s ease-in-out;
}
#fps-counter {
    top: 20px;
}
#time-counter {
    top: 55px;
    display: none;
}
#fps-counter.debug-open, #time-counter.debug-open {
    right: 280px;
}
#overlay {
    position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8); display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: white; font-family: 'Departure Mono', monospace; z-index: 20; cursor: pointer;
}

/* NEW SPLASH SCREEN STYLES */
#title-container { 
    position: absolute; 
    top: 20vh; 
    display: inline-block; 
}
#title-container h1 { 
    font-size: 7rem; 
    margin: 0; 
    text-shadow: 4px 4px 10px rgba(0,0,0,0.8); 
    font-family: sans-serif;
}
#splash-text { 
    position: absolute; 
    bottom: 0px; 
    right: -80px; 
    color: #ffff00; 
    font-size: 1.5rem; 
    font-weight: bold; 
    text-shadow: 3px 3px 6px rgba(0,0,0,0.9); 
    white-space: nowrap; 
    transform: rotate(-15deg); 
    animation: throb 0.4s infinite alternate; 
    pointer-events: none; 
}
@keyframes throb { 
    0% { transform: rotate(-15deg) scale(1); } 
    100% { transform: rotate(-15deg) scale(1.15); } 
}
#instructions { 
    margin-top: 12vh; 
    text-align: center; 
    pointer-events: none; 
}

#click-to-start {
    margin-top: 22vh;
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    color: #00ff88; /* clean minty retro green */
    text-shadow: 2px 2px 0px #000; /* crisp retro shadow, no generic glow */
    user-select: none;
    pointer-events: none;
    animation: retro-pulse 3.0s infinite steps(12);
    font-family: 'Departure Mono', monospace;
}

@keyframes retro-pulse {
    0% {
        opacity: 0.35;
        transform: scale(0.97);
    }
    50% {
        opacity: 1;
        transform: scale(1.03);
    }
    100% {
        opacity: 0.35;
        transform: scale(0.97);
    }
}

.terminal-cursor {
    display: inline-block;
    animation: terminal-blink 0.8s infinite steps(2);
    margin-left: 2px;
}

@keyframes terminal-blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

.prototype-build {
    animation: rainbow-strobe 8s linear infinite;
    margin-top: 3px;
}
@keyframes rainbow-strobe {
    0% { color: hsla(0, 100%, 70%, 0.4); }
    17% { color: hsla(60, 100%, 70%, 0.4); }
    33% { color: hsla(120, 100%, 70%, 0.4); }
    50% { color: hsla(180, 100%, 70%, 0.4); }
    67% { color: hsla(240, 100%, 70%, 0.4); }
    83% { color: hsla(300, 100%, 70%, 0.4); }
    100% { color: hsla(360, 100%, 70%, 0.4); }
}

#damage-flash, #heal-flash {
    position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 15; transition: opacity 0.1s; opacity: 0;
}
#damage-flash { background: red; }
#heal-flash { background: lime; } 
.hud-item { font-size: calc(18px * var(--ui-font-scale, 1)); margin-bottom: 5px; font-weight: bold; }
#weapon-name { color: #ffff00; }
#hp { color: #ff3333; }
#oxygen { color: #00ffff; }
#food { color: #ffaa00; }
#stamina { color: #33ccff; }
#speedometer { color: #00ff66; }
#gear-status { color: #ff33aa; font-weight: 900; }

.panel {
    background: rgba(20, 20, 20, 0.95); border: 2px solid #555; 
    border-radius: 8px; padding: 15px; box-shadow: 0 0 20px rgba(0,0,0,0.8);
    font-family: 'Departure Mono', monospace; color: white;
    font-size: calc(12px * var(--ui-font-scale, 1));
}
.panel h2 { margin: 0 0 10px 0; font-size: calc(15px * var(--ui-font-scale, 1)); text-align: center; }

#interact-tooltip {
    position: absolute; top: 55%; left: 50%; transform: translate(-50%, -50%);
    color: white; font-family: 'Departure Mono', monospace; font-size: calc(14px * var(--ui-font-scale, 1)); font-weight: bold;
    text-shadow: 1px 1px 2px #000; display: none; pointer-events: none; z-index: 12;
}

#stair-menu {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    display: none; z-index: 50; width: 220px; text-align: center;
}
#stair-menu button {
    background: #444; color: white; border: 1px solid #666; 
    cursor: pointer; padding: 12px; font-size: calc(12px * var(--ui-font-scale, 1)); 
    border-radius: 4px; width: 100%; margin-bottom: 8px;
    font-family: 'Departure Mono', monospace; font-weight: bold;
}
#stair-menu button:hover { background: #666; }

/* BULLET COUNTER HUD STYLE */
#bullet-counter-wrapper {
    position: relative;
    overflow: hidden;
    background: rgba(20, 20, 25, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    margin-bottom: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    display: none;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    pointer-events: none;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#bullet-counter-wrapper.visible {
    display: block;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#bullet-counter {
    position: relative;
    z-index: 1;
    padding: 6px 16px;
    color: #ffb703;
    font-family: 'Departure Mono', monospace;
    font-size: calc(16px * var(--ui-font-scale, 1));
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    user-select: none;
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* HOTBAR STYLES */
#hotbar-container {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 10; pointer-events: none;
    display: none;
}
#survival-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 8px;
    color: white;
    font-family: 'Departure Mono', monospace;
    text-shadow: 2px 2px 4px #000;
}
#hotbar-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    background: rgba(20, 20, 25, 0.4);
}
#hotbar-grid {
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px;
    padding: 5px;
    background: transparent;
    position: relative;
    z-index: 1;
}
.hotbar-slot {
    width: 45px; height: 45px; background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 4px; display: flex;
    align-items: center; justify-content: center; font-size: calc(21px * var(--ui-font-scale, 1)); position: relative;
    transition: all 0.1s;
}
.hotbar-slot.active {
    border-color: #ffaa00; background: rgba(100, 100, 100, 0.8); box-shadow: 0 0 10px #ffaa00; transform: scale(1.05);
}

#inventory-screen {
    position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
    display: none; align-items: flex-start; justify-content: center; gap: 20px;
    z-index: 30; background: rgba(0, 0, 0, 0.5); user-select: none;
    padding-top: 10vh; box-sizing: border-box;
}
.inv-panel { min-width: 320px; display: flex; flex-direction: column; max-height: 80vh; }
.inv-grid { display: grid; gap: 5px; }
.player-grid { grid-template-columns: repeat(8, 1fr); }
.container-grid { grid-template-columns: repeat(5, 1fr); }
#player-ui, #crafting-ui { width: 440px; }

.inv-slot {
    aspect-ratio: 1; background: rgba(0, 0, 0, 0.6);
    border: 1px solid #444; border-radius: 4px; display: flex;
    align-items: center; justify-content: center; font-size: calc(22px * var(--ui-font-scale, 1));
    cursor: pointer; transition: background 0.1s, border-color 0.1s; position: relative;
}
.inv-slot:hover { background: rgba(100, 100, 100, 0.5); }

/* DRAG AND DROP STYLES */
.drag-item {
    position: fixed;
    pointer-events: none; /* Let events pass through to UI underneath */
    z-index: 9999;
    font-size: calc(28px * var(--ui-font-scale, 1));
    transform: translate(-50%, -50%);
    text-shadow: 2px 2px 5px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.drag-count {
    position: absolute; 
    bottom: -5px; 
    right: -5px; 
    font-size: calc(12px * var(--ui-font-scale, 1)); 
    color: #fff; 
    text-shadow: 1px 1px 3px #000;
    font-family: 'Departure Mono', monospace;
    font-weight: bold;
}

#inv-hints {
    position: absolute; bottom: 30px; color: #ccc; font-size: calc(14px * var(--ui-font-scale, 1));
    text-shadow: 1px 1px 2px #000; text-align: center; width: 100%;
}

#crafting-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding-right: 5px;
    max-height: 165px;
    transition: max-height 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: #555 rgba(0, 0, 0, 0.2);
}
#crafting-list.expanded {
    max-height: 500px;
}
#crafting-list::-webkit-scrollbar {
    width: 6px;
}
#crafting-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
#crafting-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}
#crafting-list::-webkit-scrollbar-thumb:hover {
    background: #ffaa00;
}
.craft-btn { 
    background: #2b2b2b; color: #ffffff; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); border: 1px solid #555; padding: 10px 14px; 
    cursor: pointer; text-align: left; display: flex; flex-direction: column;
    gap: 4px; border-radius: 6px; font-family: 'Departure Mono', monospace; transition: all 0.15s ease;
}
.craft-btn:hover:not(:disabled) { 
    background: #444; 
    border-color: #ffaa00;
}
.craft-btn:disabled { 
    background: #1a1a1a; 
    color: #888888;
    text-shadow: none;
    border-color: #2a2a2a;
    cursor: not-allowed; 
}
.craft-title { font-size: 16px; font-weight: bold; }
.craft-reqs { font-size: 13px; color: #aaa; display: flex; gap: 8px; flex-wrap: wrap; }

#crafting-expand-btn {
    background: rgba(30, 41, 59, 0.6);
    color: #94a3b8;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px;
    margin-top: 10px;
    cursor: pointer;
    font-family: 'Departure Mono', monospace;
    font-size: 13px;
    text-align: center;
    transition: all 0.15s ease;
}
#crafting-expand-btn:hover {
    background: rgba(51, 65, 85, 0.8);
    color: white;
    border-color: #475569;
}

#debug-menu {
    position: absolute; top: 20px; right: 20px; width: 280px;
    display: none; z-index: 40; font-size: 13px;
    max-height: 90vh; overflow-y: auto;
}
#debug-menu details {
    margin-bottom: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background: rgba(30, 30, 30, 0.4);
    overflow: hidden;
}
#debug-menu summary {
    font-weight: bold;
    padding: 6px 10px;
    cursor: pointer;
    background: #2a2a2a;
    border-bottom: 1px solid #444;
    user-select: none;
    outline: none;
    font-size: 14px;
}
#debug-menu summary:hover {
    background: #383838;
}
#debug-menu details[open] summary {
    border-bottom: 1px solid #555;
    background: #333;
}
#debug-menu details > .details-content {
    padding: 10px;
}
.dbg-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dbg-row input[type="number"], .dbg-row select { 
    background: #222; 
    color: white; 
    border: 1px solid #555; 
    padding: 3px 5px;
    font-family: 'Departure Mono', monospace;
    border-radius: 3px;
}
.dbg-row input[type="number"] { width: 55px; }
.dbg-row select { width: 150px; }
.dbg-row button, .dbg-btn { 
    background: #444; 
    color: white; 
    border: 1px solid #666; 
    cursor: pointer; 
    padding: 4px 8px;
    font-family: 'Departure Mono', monospace;
    border-radius: 3px;
}
.dbg-row button:hover, .dbg-btn:hover { background: #666; }
.spawn-btns button { font-size: 20px; padding: 5px; margin: 2px; }

/* TOOLTIP STYLES */
.tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    background: rgba(18, 18, 24, 0.85);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: 'Departure Mono', monospace;
    color: #f1f3f5;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    max-width: 260px;
    font-size: 13px;
    line-height: 1.4;
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.96);
    display: none;
}

.tooltip.visible {
    opacity: 1;
    transform: scale(1);
    display: block;
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.tooltip-emoji {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.tooltip-title {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    letter-spacing: -0.2px;
}
.tooltip-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.tooltip-badge.weapon { background: rgba(255, 75, 75, 0.2); color: #ff6b6b; border: 1px solid rgba(255, 75, 75, 0.3); }
.tooltip-badge.tool { background: rgba(255, 169, 77, 0.2); color: #ffa94d; border: 1px solid rgba(255, 169, 77, 0.3); }
.tooltip-badge.block { background: rgba(77, 171, 247, 0.2); color: #4dabf7; border: 1px solid rgba(77, 171, 247, 0.3); }
.tooltip-badge.food { background: rgba(81, 207, 102, 0.2); color: #51cf66; border: 1px solid rgba(81, 207, 102, 0.3); }
.tooltip-badge.heal { background: rgba(240, 101, 149, 0.2); color: #f06595; border: 1px solid rgba(240, 101, 149, 0.3); }
.tooltip-badge.resource { background: rgba(173, 181, 189, 0.2); color: #adb5bd; border: 1px solid rgba(173, 181, 189, 0.3); }
.tooltip-badge.craft { background: rgba(132, 94, 247, 0.2); color: #845ef7; border: 1px solid rgba(132, 94, 247, 0.3); }

.tooltip-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.tooltip-desc {
    color: #ced4da;
    font-size: 11px;
    font-style: italic;
    margin-bottom: 8px;
}

.tooltip-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: #e9ecef;
}
.tooltip-stat-row {
    display: flex;
    justify-content: space-between;
}
.tooltip-stat-label {
    color: #868e96;
}
.tooltip-stat-value {
    font-weight: 600;
}

.tooltip-reqs-title {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #845ef7;
    margin-bottom: 4px;
}
.tooltip-reqs-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}

/* MINIMALIST LOADING SCREEN */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #38a038;
    font-family: 'Departure Mono', monospace;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}
#loading-screen.fade-out {
    opacity: 0;
}
#loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
    text-align: center;
}
#loading-bar-wrapper {
    width: 300px;
    height: 6px;
    background: #111;
    border: 1px solid #38a038;
    position: relative;
}
#loading-bar {
    width: 0%;
    height: 100%;
    background: #38a038;
    box-shadow: 0 0 6px rgba(56, 160, 56, 0.7);
    transition: width 0.08s ease-out;
}

/* Coordinate Picker Panel Styles */
#picker-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 320px;
    min-width: 260px;
    min-height: 140px;
    max-width: 90vw;
    max-height: 90vh;
    resize: both;
    overflow: auto;
    z-index: 100;
    background: rgba(18, 18, 24, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    font-family: 'Departure Mono', monospace;
    color: white;
    display: none;
    user-select: none;
}
#picker-header {
    margin: -15px -15px 12px -15px;
    padding: 10px 15px;
    background: rgba(30, 30, 40, 0.9);
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    font-weight: bold;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.picker-row {
    margin-bottom: 10px;
    font-family: 'Departure Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-all;
}
.picker-copy-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Departure Mono', monospace;
    font-size: 12px;
    font-weight: bold;
    transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.picker-copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}
.picker-copy-btn:active {
    background: #ffaa00;
    color: black;
    border-color: #ffaa00;
    transform: scale(0.95);
}

/* CROSSHAIR & SUBMERGED OVERLAY STYLES */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    z-index: 15;
    display: none;
}
#crosshair.visible {
    display: block;
}
#crosshair::before, #crosshair::after {
    content: '';
    position: absolute;
    background: white;
    transition: background-color 0.1s;
}
/* Horizontal line */
#crosshair::before {
    top: 7px;
    left: 0;
    width: 16px;
    height: 2px;
}
/* Vertical line */
#crosshair::after {
    top: 0;
    left: 7px;
    width: 2px;
    height: 16px;
}
/* Recoil state */
#crosshair.recoil::before, #crosshair.recoil::after {
    background: red;
}
/* Zoom state */
#crosshair.zoomed::before {
    top: 7.5px;
    left: 4px;
    width: 8px;
    height: 1px;
}
#crosshair.zoomed::after {
    top: 4px;
    left: 7.5px;
    width: 1px;
    height: 8px;
}

#submerged-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 50, 130, 0.4);
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
#submerged-overlay.visible {
    opacity: 1;
}

/* MINING PROGRESS CIRCLE */
#mining-progress-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    z-index: 14;
    pointer-events: none;
    display: none;
}
#mining-progress-container svg {
    transform: rotate(-90deg);
    display: block;
}
#mining-progress-circle {
    transition: stroke-dashoffset 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 4px #00ff88);
}