:root { 
    --bg: #0d0d0d; --panel: #1a1a1a; --accent: #00f2ff; 
    --error: #ff1744; --warning: #ff9800; --garrett-gray: #616161;
    --led-off: #111; --led-on: #ff0000; --tray-bg: #252525;
    --signal-low: #4caf50; --signal-med: #ffeb3b; --signal-high: #f44336;
}

body { font-family: 'Segoe UI', sans-serif; background: var(--bg); color: white; margin: 0; padding: 10px; overflow-x: hidden; transition: 0.5s; }

#login-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95); z-index: 3000; display: flex; flex-direction: column; justify-content: center; align-items: center; }
#end-screen { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95); z-index: 3000; flex-direction: column; justify-content: center; align-items: center; }

.login-card, .end-card { background: #1e1e1e; padding: 40px; border-radius: 12px; border-top: 5px solid var(--accent); text-align: center; box-shadow: 0 10px 40px rgba(0,242,255,0.2); width: 350px; max-width: 90%; }
.login-card h1, .end-card h1 { color: white; margin-top: 0; font-size: 1.5rem; text-transform: uppercase; }
.login-card input { width: 100%; padding: 15px; margin-bottom: 20px; background: #333; border: 1px solid #555; color: white; border-radius: 6px; font-size: 1.1rem; box-sizing: border-box; text-align: center; }
.btn-start-shift { background: var(--accent); color: #000; width: 100%; padding: 15px; font-size: 1.1rem; font-weight: bold; text-transform: uppercase; border: none; border-radius: 6px; cursor: pointer; transition: 0.2s; }

#game-interface { display: none; }

.container { max-width: 1200px; margin: auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; position: relative; }
.status-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; background: var(--panel); padding: 15px; border-radius: 12px; margin-bottom: 20px; border-bottom: 3px solid var(--accent); box-shadow: 0 4px 15px rgba(0,0,0,0.5); gap: 10px; }
.status-badge { background: #333; padding: 5px 15px; border-radius: 6px; font-family: monospace; font-size: 1.1rem; text-align: center; flex: 1; min-width: 120px; }
#btn-next { background: var(--accent); color: #000; padding: 12px 20px; flex: 1; min-width: 200px; border-radius: 6px; font-weight: bold; border: none; cursor: pointer; text-transform: uppercase; }

.pacing-lights { display: flex; justify-content: center; gap: 20px; margin-bottom: 15px; background: #000; padding: 10px 20px; border-radius: 8px; border: 2px solid #333; width: 100%; max-width: 280px; box-sizing: border-box; }
.pacing-icon { font-size: 1.5rem; opacity: 0.2; font-weight: bold; }
.pacing-icon.red.active { color: #ff1744; opacity: 1; text-shadow: 0 0 15px #ff1744; }
.pacing-icon.green.active { color: #00e676; opacity: 1; text-shadow: 0 0 15px #00e676; }

.gate-area { background: var(--panel); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; align-items: center; position: relative; border: 1px solid #333; }
.signal-display { width: 100%; max-width: 320px; height: 20px; background: #222; border: 2px solid #444; border-radius: 4px; margin-bottom: 15px; position: relative; }
#signal-bar { height: 100%; width: 0%; background: var(--signal-low); transition: 0.3s; }

.garrett-wrapper { position: relative; display: flex; justify-content: center; }
.garrett-frame { width: 320px; height: 500px; border: 15px solid var(--garrett-gray); position: relative; display: flex; justify-content: center; box-sizing: border-box; }
.led-panel { position: absolute; top: 0; width: 12px; height: 100%; display: flex; flex-direction: column; justify-content: space-around; padding: 5px 0; }
.left-leds { left: -15px; } .right-leds { right: -15px; }
.led-seg { width: 100%; height: 15px; background: var(--led-off); transition: 0.1s; border-radius: 2px; }
.led-seg.active { background: var(--led-on); box-shadow: 0 0 10px var(--led-on); }

svg { width: 220px; height: 450px; margin-top: 20px; }
.body-part { fill: #333; transition: 0.3s; }
.body-part.alarm { fill: rgba(255, 23, 68, 0.6); }

.controls { background: var(--panel); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; border: 1px solid #333; position: relative;}

.tray-zone { background: var(--tray-bg); border: 2px dashed #444; border-radius: 8px; padding: 15px; margin-bottom: 20px; min-height: 80px;}
#tray-content { display: flex; flex-wrap: wrap; gap: 15px; color: var(--accent); }

.worker-info { margin-bottom: 20px; border-left: 4px solid var(--accent); padding-left: 15px; min-height: 50px; }
.role-badge { display: inline-block; background: #5e35b1; color: white; padding: 3px 8px; border-radius: 4px; font-size: 0.8rem; margin-left: 10px; font-weight: bold; }
.id-badge { display: inline-block; background: #1976d2; color: white; padding: 3px 8px; border-radius: 4px; font-family: monospace; font-size: 1rem; margin-left: 10px; border: 2px solid #64b5f6; }

.logs { background: #000; border-radius: 8px; padding: 15px; height: 160px; overflow-y: auto; font-family: 'Consolas', monospace; font-size: 0.85rem; color: #0f0; margin-bottom: 20px; border: 1px solid #222; }

.tray-item { display: flex; align-items: center; background: #2a2a2a; border: 1px solid #555; padding: 5px 10px; border-radius: 6px; gap: 10px; cursor: pointer; transition: 0.2s; position: relative; min-width: 150px; }
.tray-item:hover { background: #3a3a3a; border-color: var(--accent); transform: scale(1.05); }
.tray-item img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; background: transparent; }

.phone-sticker { position: absolute; top: -10px; right: -10px; background: #ffeb3b; color: #000; font-size: 0.85rem; padding: 4px 8px; font-weight: bold; border-radius: 4px; border: 2px solid #000; box-shadow: 0 4px 8px rgba(0,0,0,0.8); z-index: 10; }

button { padding: 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; text-transform: uppercase; transition: 0.2s; font-size: 0.75rem; }
button:active { transform: scale(0.98); }
.btn-action { background: #424242; color: white; }
.btn-special { background: #00796b; color: white; }
.btn-pass { background: #2e7d32; color: white; width: 100%; padding: 15px; margin-top: 10px;}
.btn-pass:disabled { background: #1b301c; color: #555; cursor: not-allowed; }
.btn-escalate { background: #b71c1c; color: white; width: 100%; padding: 15px; margin-top: 10px; border: 2px solid #ff1744; }

.control-section { margin-bottom: 15px; background: #222; padding: 15px; border-radius: 8px; border: 1px solid #333; }
.btn-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.btn-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

#inspect-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 2000; justify-content: center; align-items: center; }
.inspect-card { background: #1e1e1e; padding: 30px; border-radius: 12px; width: 450px; max-width: 90%; text-align: center; border: 2px solid var(--accent); box-shadow: 0 0 30px rgba(0, 242, 255, 0.3); }
.inspect-card h2 { color: white; margin-top: 0; }
.inspect-img-container { width: 100%; height: 250px; background: #fff; border-radius: 8px; display: flex; justify-content: center; align-items: center; margin-bottom: 20px; overflow: hidden; }
.inspect-img-container img { max-width: 90%; max-height: 90%; object-fit: contain; }
.btn-inspect-action { background: #ff9800; color: #000; width: 100%; padding: 15px; font-size: 1rem; margin-bottom: 10px; }
.btn-inspect-close { background: #555; width: 100%; padding: 12px; }

#distraction-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; overflow: hidden; }
.spam-msg { position: absolute; background: rgba(255, 23, 68, 0.9); color: white; padding: 12px 24px; font-weight: bold; border-radius: 8px; font-size: 1.1rem; box-shadow: 0 5px 20px rgba(0,0,0,0.8); border: 2px solid white; animation: popInOut 2.5s forwards; pointer-events: auto; max-width: 250px; text-align: center; }
@keyframes popInOut { 0% { transform: scale(0.5); opacity: 0; } 10% { transform: scale(1.1); opacity: 1; } 20% { transform: scale(1); opacity: 1; } 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.8); opacity: 0; } }
.talkative-badge { background: #ff9800; color: #000; padding: 3px 8px; border-radius: 4px; font-weight: bold; font-size: 0.8rem; margin-left: 10px; display: inline-block; animation: blink 1s infinite; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }
 /* --- SYSTEM OSIĄGNIĘĆ --- */
.badges-grid {
display: flex;
gap: 15px;
justify-content: center;
flex-wrap: wrap;
}
.badge {
background: #111;
border: 2px solid #444;
border-radius: 50%;
width: 60px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
position: relative;
cursor: help;
transition: all 0.3s ease;
filter: grayscale(100%);
opacity: 0.5;
}
.badge.earned {
border-color: var(--accent);
filter: grayscale(0%);
opacity: 1;
box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
transform: scale(1.1);
}
.badge::after {
content: attr(data-title);
position: absolute;
bottom: -30px;
background: rgba(0,0,0,0.9);
color: white;
font-size: 12px;
padding: 5px 10px;
border-radius: 5px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: 0.2s;
z-index: 10;
}
.badge:hover::after { opacity: 1; }