/* ==========================================================================
   VOID PLATFORM - MASTER STYLESHEET
   ========================================================================== */

/* --- RESET & GLOBALNE --- */
* { box-sizing: border-box; }

a { color: #00ff00; text-decoration: none; }
a:hover { text-shadow: 0 0 5px #00ff00; }

/* ==========================================================================
   1. INDEX.PHP (LOGOWANIE / REJESTRACJA / RESET HASŁA)
   ========================================================================== */
.login-body { 
    font-family: 'Courier New', monospace; 
    background: #0a0a0a; 
    color: #00ff00; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    margin: 0; 
}

.box { 
    background: #111; 
    padding: 30px; 
    border-radius: 4px; 
    border: 1px solid #00ff00; 
    width: 350px; 
    box-shadow: 0 0 15px rgba(0,255,0,0.2); 
}

.box h2 { 
    text-transform: uppercase; 
    text-align: center; 
    border-bottom: 1px solid #00ff00; 
    padding-bottom: 10px; 
    margin-top: 0;
}

.box input { 
    width: 100%; 
    padding: 12px; 
    margin: 8px 0; 
    background: #000; 
    border: 1px solid #00ff00; 
    color: #00ff00; 
    box-sizing: border-box; 
    font-family: 'Courier New', monospace;
}
.box input:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(0,255,0,0.4);
}

.box button { 
    width: 100%; 
    padding: 12px; 
    background: #00ff00; 
    color: #000; 
    border: none; 
    cursor: pointer; 
    font-weight: bold; 
    text-transform: uppercase; 
    margin-top: 5px; 
    font-family: 'Courier New', monospace;
    transition: 0.2s;
}
.box button:hover {
    background: #00cc00;
    box-shadow: 0 0 10px rgba(0,255,0,0.5);
}

.lang-switch { 
    text-align: right; 
    margin-bottom: 10px; 
    font-size: 0.7em; 
}
.lang-switch a { 
    color: #00ff00; 
    text-decoration: none; 
    margin-left: 5px; 
}

.msg { 
    border: 1px solid #ffc107; 
    color: #ffc107; 
    padding: 10px; 
    margin-bottom: 15px; 
    font-size: 0.8em; 
    text-align: center; 
    background: rgba(255,193,7,0.1);
}

.nav-links { 
    font-size: 0.8em; 
    text-align: center; 
    margin-top: 15px; 
    line-height: 1.8; 
}


/* ==========================================================================
   2. CREATOR.PHP (KREATOR POSTACI)
   ========================================================================== */
.creator-body { 
    margin: 0; 
    padding: 0;
    overflow: hidden; 
    background: #111; 
    color: white; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex; 
    flex-direction: row; 
    width: 100vw; 
    height: 100vh;
}

#renderCanvas-creator { 
    width: 55vw;      
    min-width: 55vw;  
    height: 100vh;
    outline: none;
    touch-action: none;
    background: #0d0d0d;
    display: block;
}

#uiPanel { 
    width: 45vw;      
    min-width: 45vw;
    height: 100vh;
    background: #151515; 
    padding: 30px; 
    border-left: 1px solid #333; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
    overflow-y: auto;    
}

#uiPanel::-webkit-scrollbar { width: 8px; }
#uiPanel::-webkit-scrollbar-track { background: #111; }
#uiPanel::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
#uiPanel::-webkit-scrollbar-thumb:hover { background: #555; }

.form-container {
    width: 100%;
    max-width: 550px; 
}

.form-container h2 { 
    border-bottom: 2px solid #4CAF50; 
    padding-bottom: 10px; 
    margin-top: 0; 
    margin-bottom: 25px;
    color: #fff; 
    text-align: center; 
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.6em;
}

#dynamicControls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.control-group { 
    width: 100%;
}

.control-group label { 
    display: block; 
    margin-bottom: 6px; 
    color: #888;
    font-size: 0.75em; 
    letter-spacing: 1px; 
    text-transform: uppercase; 
    font-weight: bold; 
}

.control-group select { 
    width: 100%; 
    padding: 10px;
    background: #252525; 
    color: #eee; 
    border: 1px solid #444; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 14px; 
    transition: 0.2s;
    font-family: 'Segoe UI', sans-serif;
}
.control-group select:hover { background: #303030; border-color: #666; }
.control-group select:focus { outline: none; border-color: #4CAF50; }

#saveBtn { 
    margin-top: 10px;
    padding: 15px;
    background: #2e7d32; 
    color: white;
    border: none; 
    font-weight: bold; 
    font-size: 16px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
    width: 100%;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
#saveBtn:hover { background: #43a047; transform: translateY(-2px); }
#saveBtn:disabled { background: #444; cursor: not-allowed; opacity: 0.7; transform: none; box-shadow: none; color: #aaa; }

#status { text-align: center; margin-top: 15px; font-size: 0.9em; min-height: 20px; width: 100%; }


/* ==========================================================================
   3. MAIN.PHP (GRA & INTERFEJS)
   ========================================================================== */
.game-body { 
    overflow: hidden; 
    width: 100%; 
    height: 100%; 
    margin: 0; 
    padding: 0; 
    background: #000; 
    font-family: 'Segoe UI', monospace; 
}

#renderCanvas-game { 
    width: 100%; 
    height: 100%; 
    touch-action: none; 
    outline: none; 
}

#loadingScreen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: center;
    color: white; font-size: 24px; font-weight: bold; z-index: 100; cursor: pointer; flex-direction: column;
}

.ready-btn { 
    border: 2px solid white; padding: 20px 40px; border-radius: 5px; 
    background: rgba(0, 255, 0, 0.1); transition: 0.3s; 
}
.ready-btn:hover { background: rgba(0, 255, 0, 0.4); }

#systemUI { position: absolute; bottom: 10px; left: 10px; z-index: 20; color: #aaa; font-size: 12px; pointer-events: none; }
#logoutBtn { position: absolute; bottom: 10px; right: 10px; z-index: 20; padding: 8px 15px; background: #d32f2f; color: white; border: none; cursor: pointer; }

/* MODALE (Karta Postaci i Ekwipunek) */
.modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); z-index: 200;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.close-sheet { padding: 5px 20px; background: #d32f2f; color: white; border: none; cursor: pointer; font-weight: bold; border-radius: 3px; }
.close-sheet:hover { background: #f44336; }

/* Karta Postaci (C) */
.sheet-container {
    width: 900px; height: 600px; background: #1a1a1a; border: 2px solid #444;
    box-shadow: 0 0 30px rgba(0,0,0,0.8); display: flex; gap: 20px; padding: 20px;
    color: #ddd; position: relative;
}
.sheet-portrait { flex: 1; display: flex; flex-direction: column; }
.sheet-stats, .sheet-skills { flex: 1; border-left: 1px solid #333; padding-left: 20px; }
.sheet-container h3 { border-bottom: 1px solid #555; padding-bottom: 10px; margin-top: 0; color: #4CAF50; text-align: center; }

/* Nowy Ekwipunek (I) */
.inv-container {
    width: 1000px; height: 650px; 
    background: #141414; border: 2px solid #444;
    box-shadow: 0 0 40px rgba(0,0,0,0.9); 
    display: flex; flex-direction: row; 
    color: #ddd; padding: 0; position: relative;
}

.inv-left-panel {
    width: 350px; background: #1a1a1a; border-right: 2px solid #333;
    display: flex; flex-direction: column; align-items: center; padding: 20px; position: relative;
}
.paper-doll-grid {
    width: 100%; height: 400px; position: relative;
    background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 70%); 
    border-radius: 10px; border: 1px solid #333; margin-bottom: 20px;
}

.item-slot {
    width: 60px; height: 60px;
    background: rgba(0,0,0,0.5); border: 1px solid #555;
    position: absolute; 
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s; box-shadow: inset 0 0 10px #000;
}
.item-slot:hover { border-color: #aaa; background: rgba(255,255,255,0.05); }
.item-slot.active { border-color: #4CAF50; box-shadow: 0 0 15px rgba(76, 175, 80, 0.3); }

/* Pozycje na ciele */
.slot-head      { top: 20px;  left: 50%; transform: translateX(-50%); } 
.slot-shoulders { top: 90px;  left: 50px; } 
.slot-hands     { top: 90px;  right: 50px; } 
.slot-torso     { top: 100px; left: 50%; transform: translateX(-50%); width: 70px; height: 90px; } 
.slot-hips      { top: 210px; left: 50%; transform: translateX(-50%); width: 70px; height: 50px;} 
.slot-legs      { top: 280px; left: 50%; transform: translateX(-50%); } 
.slot-boots     { top: 350px; left: 50%; transform: translateX(-50%); } 

.item-stats-panel {
    width: 100%; flex: 1; background: #222; border: 1px solid #444;
    padding: 10px; font-size: 12px; color: #bbb; overflow-y: auto;
}
.stat-title { color: #4CAF50; font-weight: bold; border-bottom: 1px solid #444; margin-bottom: 5px; padding-bottom: 2px;}

.inv-right-panel {
    flex: 1; display: flex; flex-direction: column; padding: 20px; background: #111;
}
.inv-hotbar-section {
    height: 90px; border-bottom: 1px solid #333; margin-bottom: 10px;
    display: flex; align-items: center; justify-content: center; gap: 15px;
    background: #181818; border-radius: 5px;
}
.inv-hotbar-section .item-slot { position: relative; top: auto; left: auto; transform: none; }

.inv-tabs { display: flex; gap: 2px; margin-bottom: 0; }
.inv-tab-btn {
    padding: 8px 20px; background: #222; color: #888; border: 1px solid #333; border-bottom: none;
    cursor: pointer; font-weight: bold; border-radius: 5px 5px 0 0;
}
.inv-tab-btn:hover { background: #333; color: #ddd; }
.inv-tab-btn.active { background: #111; color: #4CAF50; border-top: 2px solid #4CAF50; height: 40px; }

#invGrid {
    flex: 1; background: #111; border: 1px solid #333; padding: 10px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    grid-auto-rows: 64px; gap: 8px; overflow-y: auto;
}
#invGrid .item-slot { position: relative; width: 100%; height: 100%; top: auto; left: auto; transform: none; }

.inv-item-label {
    position: absolute; bottom: 2px; width: 100%; text-align: center;
    font-size: 9px; color: #ccc; pointer-events: none; text-shadow: 1px 1px 0 #000;
}

/* HUD (Celownik, Hotbar, Busola) */
#hotbar {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px; background: rgba(0,0,0,0.5); padding: 10px;
    border-radius: 8px; border: 1px solid #444; pointer-events: none; z-index: 40;
}

.hotbar-slot {
    width: 64px; height: 64px; background: #222; border: 2px solid #555;
    display: flex; align-items: center; justify-content: center; position: relative; transition: 0.2s;
}
.hotbar-slot.active { border-color: #4CAF50; box-shadow: 0 0 10px #4CAF50; transform: scale(1.1); }

.hotbar-icon {
    width: 100%; height: 100%; object-fit: contain;
    position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none;
    padding: 4px; box-sizing: border-box; filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.8));
}

.slot-key { 
    position: absolute; top: 2px; left: 5px; 
    font-size: 14px; color: #fff; font-weight: bold; z-index: 10; pointer-events: none;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000;
}

#crosshair {
    position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; 
    background: white; border-radius: 50%; transform: translate(-50%, -50%); 
    pointer-events: none; z-index: 50; box-shadow: 0 0 4px black; opacity: 0.8;
}
#interactionLabel {
    position: absolute; top: 53%; left: 50%; transform: translate(-50%, 0);
    color: white; font-family: sans-serif; font-weight: bold; font-size: 14px;
    text-shadow: 1px 1px 2px black; pointer-events: none; z-index: 50; display: none;
    background: rgba(0,0,0,0.6); padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.2);
}

#contextMenu {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(20, 20, 20, 0.95); border: 1px solid #4CAF50; border-radius: 4px;
    display: none; flex-direction: column; min-width: 150px; z-index: 100; pointer-events: auto;
}
.ctx-header { background: #111; color: #888; padding: 5px 10px; font-size: 12px; text-transform: uppercase; border-bottom: 1px solid #333; }
.ctx-option { padding: 10px 15px; color: white; cursor: pointer; transition: 0.2s; border-left: 3px solid transparent; }
.ctx-option:hover { background: #333; border-left-color: #4CAF50; }

#actionProgressContainer {
    position: absolute; top: 60%; left: 50%; transform: translate(-50%, -50%);
    width: 200px; height: 20px; background: #222; border: 2px solid white;
    border-radius: 10px; display: none; overflow: hidden; z-index: 60;
}
#actionProgressBar { width: 0%; height: 100%; background: linear-gradient(90deg, #ff9800, #ffeb3b); }
#actionLabel { position: absolute; top: -25px; width: 100%; text-align: center; color: white; font-weight: bold; text-shadow: 1px 1px 2px black; }

#gameMessages {
    position: absolute; bottom: 15%; left: 50%; transform: translate(-50%, 0);
    display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 60; width: 400px;
}
.message-toast {
    background: rgba(0, 0, 0, 0.7); color: #4CAF50; border-left: 4px solid #4CAF50;
    padding: 10px 20px; margin-top: 5px; border-radius: 4px; font-size: 16px; font-weight: bold;
    text-shadow: 1px 1px 2px black; animation: fadeOut 4s forwards; opacity: 0;
}
@keyframes fadeOut {
    0% { opacity: 0; transform: translateY(20px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

#hud-top {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    width: 600px; height: auto; pointer-events: none;
    display: flex; flex-direction: column; align-items: center; z-index: 10;
}
#heightInfo { display: none !important; }
#compass-container {
    width: 400px; height: 40px; position: relative; overflow: hidden;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.8) 20%, rgba(0,0,0,0.8) 80%, transparent 100%);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}
#compass-strip { position: relative; height: 100%; will-change: transform; }
.compass-mark {
    position: absolute; top: 10px; color: white;
    font-family: monospace; font-weight: bold; font-size: 16px;
    transform: translateX(-50%); text-shadow: 1px 1px 2px black;
}
.compass-mark.major { font-size: 20px; color: #ffeb3b; top: 8px; }
#compass-arrow {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    color: red; font-size: 20px; z-index: 11; text-shadow: 0 2px 2px black;
}
#coords-text {
    margin-top: 8px; font-family: monospace; font-size: 12px;
    color: rgba(255,255,255,0.7); background: rgba(0,0,0,0.5);
    padding: 2px 6px; border-radius: 4px;
}