body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; font-family: 'Segoe UI', Tahoma, sans-serif; background-color: #0f1021; color: #e2e8f0; }
.hidden { display: none !important; }

#lobby-screen { display: flex; justify-content: center; align-items: center; height: 100vh; background: radial-gradient(circle at center, #1b1e36 0%, #080914 100%); }
.lobby-container { background: rgba(20, 22, 43, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 40px; border-radius: 20px; border: 1px solid rgba(255, 215, 0, 0.3); text-align: center; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.1); max-width: 800px; width: 90%; }
.game-title { color: #ffd700; text-shadow: 0 0 15px rgba(255, 215, 0, 0.6); font-size: 42px; margin-top: 0; letter-spacing: 2px;}
.subtitle { color: #a0aec0; margin-bottom: 25px; font-size: 18px; }

input[type="text"] { padding: 12px; font-size: 16px; border-radius: 8px; border: 1px solid #4a5568; background: rgba(45, 55, 72, 0.7); color: white; outline: none; transition: border 0.3s; width: 80%; max-width: 300px; margin-bottom: 20px; text-align: center; }
input[type="text"]:focus { border-color: #ffd700; }

.glow-btn { padding: 12px 25px; font-size: 18px; background: linear-gradient(45deg, #d53f8c, #805ad5); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(213, 63, 140, 0.4); }
.glow-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(213, 63, 140, 0.6); }
.start-btn { background: linear-gradient(45deg, #ff8c00, #ff4500); box-shadow: 0 4px 15px rgba(255, 69, 0, 0.4); margin-top: 15px; width: 100%;}
.start-btn:hover { box-shadow: 0 6px 20px rgba(255, 69, 0, 0.6); }
.info-btn { margin-top: 30px; background: linear-gradient(45deg, #2b6cb0, #2c5282); font-size: 15px; padding: 10px 20px; box-shadow: 0 4px 15px rgba(43, 108, 176, 0.4); }

.lobby-columns { display: flex; flex-direction: row; gap: 40px; justify-content: space-between; text-align: left; margin-top: 20px; }
.lobby-left { flex: 1; min-width: 250px; background: rgba(0,0,0,0.3); padding: 20px; border-radius: 12px; }
.lobby-right { flex: 1; min-width: 250px; display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.3); padding: 20px; border-radius: 12px;}
.lobby-columns h2 { margin-top: 0; color: #e2e8f0; font-size: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; text-align: center; width: 100%; }

#players-list { list-style: none; padding: 0; font-size: 18px; margin: 0; max-height: 250px; overflow-y: auto; }

#character-selector { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 20px; margin-top: 10px; }
.arrow-btn { background: none; border: none; color: #ffd700; font-size: 30px; cursor: pointer; transition: transform 0.2s, text-shadow 0.2s; padding: 0 10px; }
.arrow-btn:hover { transform: scale(1.2); text-shadow: 0 0 10px #ffd700; }
.preview-container { text-align: center; }
#character-preview { width: 100px; height: 100px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255,255,255,0.2)); transition: filter 0.3s; }
#color-name { margin: 5px 0 0 0; font-weight: bold; color: #a0aec0; text-transform: uppercase; font-size: 14px; letter-spacing: 1px; }

.control-group { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; }
#score-selector { display: flex; align-items: center; justify-content: center; gap: 15px; font-size: 28px; font-weight: bold; color: #fff; text-shadow: 0 0 10px #ffd700; }
#score-limit-display { min-width: 50px; text-align: center; }

.waiting-text { color: #ffd700; font-style: italic; animation: pulse 2s infinite; text-align: center; margin-top: 30px;}
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* NOWE: Style Modal z Instrukcją */
#instructions-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 2000; }
.instructions-container { background: rgba(20, 22, 43, 0.95); border: 2px solid #ffd700; border-radius: 15px; padding: 40px; max-width: 600px; width: 90%; position: relative; box-shadow: 0 0 40px rgba(255, 215, 0, 0.2); text-align: left; }
.instructions-container h2 { color: #ffd700; margin-top: 0; text-align: center; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); border-bottom: 1px solid rgba(255, 215, 0, 0.3); padding-bottom: 15px; margin-bottom: 20px;}
.close-btn { position: absolute; top: 15px; right: 20px; background: transparent; border: none; color: #a0aec0; font-size: 28px; cursor: pointer; transition: color 0.2s; }
.close-btn:hover { color: #ff4500; }
.inst-grid { display: flex; flex-direction: column; gap: 15px; }
.inst-box { background: rgba(0,0,0,0.4); padding: 15px 20px; border-radius: 10px; border-left: 4px solid #ffd700; }
.inst-box h3 { margin: 0 0 10px 0; color: #e2e8f0; font-size: 18px; }
.inst-box p { margin: 8px 0; color: #cbd5e0; line-height: 1.5; font-size: 15px;}

/* NOWE: Piękny wygląd klawiszy klawiatury */
kbd { background-color: #2d3748; border: 1px solid #4a5568; border-radius: 4px; box-shadow: 0 3px 0 #1a202c; color: #fff; display: inline-block; font-size: 0.9em; font-weight: bold; padding: 4px 8px; margin: 0 3px; vertical-align: text-bottom; }

#countdown-overlay { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; z-index: 100; }
#countdown-text { font-size: 150px; color: #ffd700; text-shadow: 0 0 50px #ff4500; margin: 0; animation: pop 1s infinite; }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 50% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

#victory-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(10, 11, 25, 0.95); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 1000; overflow: hidden; }
.victory-content { text-align: center; z-index: 1001; animation: scaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
#victory-winner { font-size: 80px; color: #ffd700; text-shadow: 0 0 30px #ff4500, 0 0 10px #ffd700; margin: 0; text-transform: uppercase; }
.victory-content p { font-size: 24px; color: #a0aec0; margin-top: 20px; }
.confetti { position: absolute; width: 12px; height: 12px; animation: fall linear forwards; }
@keyframes fall { 0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } }
@keyframes scaleIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

#game-screen { position: relative; width: 100vw; height: 100vh; }
#game-canvas { display: block; }
#ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

#scoreboard { position: absolute; top: 20px; right: 20px; background: rgba(15, 16, 33, 0.85); border: 2px solid #ffd700; padding: 15px; border-radius: 10px; box-shadow: 0 0 15px rgba(255,215,0,0.3); min-width: 200px; }
#scoreboard h3 { margin: 0 0 10px 0; color: #ffd700; text-align: center; border-bottom: 1px solid rgba(255,215,0,0.5); padding-bottom: 5px;}
#score-list { list-style: none; padding: 0; margin: 0; }
#score-list li { padding: 5px 0; font-size: 18px; display: flex; justify-content: space-between; }
.leader-text { color: #ff8c00; font-weight: bold; text-shadow: 0 0 10px #ff4500; }

#mana-bar-container { position: absolute; bottom: 240px; right: 20px; width: 200px; height: 20px; background: rgba(0,0,0,0.6); border: 2px solid #4a5568; border-radius: 10px; overflow: hidden; }
#mana-bar-fill { width: 100%; height: 100%; background: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%); box-shadow: 0 0 10px rgba(0, 210, 255, 0.8); transition: width 0.1s linear;}
#spell-ui { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); background: rgba(15, 16, 33, 0.9); border: 2px solid #ffd700; padding: 10px 30px; border-radius: 10px; font-size: 24px; font-weight: bold; text-shadow: 0 0 5px black; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
#current-spell-text { color: #888; transition: color 0.3s, text-shadow 0.3s; }
.spell-fire { color: #ff4500 !important; text-shadow: 0 0 10px #ff4500 !important; }
.spell-shield { color: #00bfff !important; text-shadow: 0 0 10px #00bfff !important; }
#minimap-container { position: absolute; bottom: 20px; right: 20px; border: 3px solid #ffd700; border-radius: 10px; overflow: hidden; box-shadow: 0 0 15px rgba(255,215,0,0.3); background: #080914;}
#chat-container { position: absolute; bottom: 20px; left: 20px; width: 350px; pointer-events: auto; background: rgba(0, 0, 0, 0.5); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
#chat-messages { list-style: none; padding: 0; margin: 0 0 10px 0; max-height: 150px; overflow-y: auto; font-size: 14px; text-shadow: 1px 1px 2px black; flex-grow: 1; }
#chat-messages li { margin-bottom: 5px; word-wrap: break-word; }
#chat-messages strong { color: #ffd700; }
#chat-input { width: 100%; box-sizing: border-box; background: rgba(255, 255, 255, 0.1); border: 1px solid #ffd700; color: white; padding: 8px; border-radius: 5px; transition: background 0.3s; }
#chat-input:focus { background: rgba(255, 255, 255, 0.2); outline: none; }
