/* style.css */

/* --- VÁLTOZÓK & TÉMÁK --- */
:root {
  /* Alap (Hacker) Téma */
  --primary: #00ff41;
  --bg: #050a0e;
  --ai: #00e5ff;
  --err: #ff3333;
  --warn: #ffd700;
  --font-main: 'Share Tech Mono', monospace;
  --crt-opacity: 1;
  --scanline-display: block;
  --border-radius: 4px;
  --box-shadow: 0 0 20px var(--primary), inset 0 0 20px rgba(0, 255, 65, 0.1);
}

/* Téma Variációk */
body.neon {
  --primary: #ff00ff;
  --bg: #0e0509;
  --ai: #00ffff;
  --err: #ffff00;
  --warn: #00ffff;
}

body.amber {
  --primary: #ffb000;
  --bg: #1a1100;
  --ai: #ff5500;
  --err: #ff0000;
  --warn: #ffcc00;
}

body.simple {
  --primary: #333333;
  --bg: #f4f4f9;
  --ai: #0066cc;
  --err: #cc0000;
  --warn: #d4af37;
  --font-main: 'Inter', sans-serif;
  --crt-opacity: 1;
  --scanline-display: none;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark Simple Téma */
body.dark-simple {
  --primary: #e0e0e0;
  --bg: #1a1a1a;
  --ai: #7dd3fc;
  --err: #fca5a5;
  --warn: #fcd34d;
  --font-main: 'Inter', sans-serif;
  --crt-opacity: 1;
  --scanline-display: none;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* --- ALAP BEÁLLÍTÁSOK --- */
body {
  background-color: var(--bg);
  color: var(--primary);
  font-family: var(--font-main);
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: all 0.5s;
}

/* CRT Scanline Effekt */
body::after {
  content: " ";
  display: var(--scanline-display);
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

/* --- FŐ KONTÉNER (TERMINÁL) --- */
#terminal {
  width: 95%;
  max-width: 1000px;
  height: 90vh;
  border: 2px solid var(--primary);
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.85);
  position: relative;
  z-index: 1;
  opacity: 0.1;
  pointer-events: none;
  transition: opacity 1s, background 0.5s, color 0.5s;
}

/* Mobilbarát magasság */
@supports (height: 100dvh) {
  #terminal {
    height: 95dvh;
  }
}

body.simple #terminal {
  border: 1px solid #ccc;
  background: #ffffff;
}

body.dark-simple #terminal {
  border: 1px solid #333;
  background: #2a2a2a;
}

/* --- FEJLÉC & NAVIGÁCIÓ --- */
header {
  padding: 15px;
  border-bottom: 1px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0; /* Ne nyomódjon össze */
}

body.simple header {
  border-bottom: 1px solid #eee;
  background: #fff;
}

body.dark-simple header {
  border-bottom: 1px solid #444;
  background: #1a1a1a;
}

.stats-bar {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 1.1em;
}

.money-display {
  color: var(--warn);
  font-weight: bold;
  text-shadow: 0 0 5px var(--warn);
}

body.simple .money-display {
  text-shadow: none;
  color: #d4af37;
}

body.dark-simple .money-display {
  text-shadow: none;
  color: var(--warn);
}

.level-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* SZINTVÁLTÓ GOMBOK */
.lvl-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 1.2em;
  cursor: pointer;
  padding: 2px 5px;
  transition: color 0.2s, text-shadow 0.2s, transform 0.2s;
  transform: skewX(-5deg);
}

.lvl-btn:disabled {
  opacity: 0.3;
  cursor: default;
  transform: skewX(-5deg);
}

.lvl-btn:hover:not(:disabled) {
  color: var(--ai);
  text-shadow: 0 0 8px var(--ai), 0 0 15px rgba(0, 229, 255, 0.4);
  transform: skewX(0deg) scale(1.1);
  animation: flicker 0.15s infinite alternate;
}

.nav-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
  display: block;
  transition: transform 0.2s;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* --- ENERGIA SÁV --- */
.energy-container {
  display: flex;
  align-items: center;
  gap: 5px;
}

.energy-bar-bg {
  width: 100px;
  height: 10px;
  border: 1px solid var(--primary);
  position: relative;
  background: rgba(0, 0, 0, 0.5);
}

.energy-bar-fill {
  height: 100%;
  background: var(--primary);
  width: 100%;
  transition: width 0.5s, background-color 0.5s;
}

.energy-low {
  background: var(--err) !important;
  box-shadow: 0 0 5px var(--err);
}

/* --- GOMBOK & INPUTOK (ÁLTALÁNOS) --- */
button, select {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  text-transform: uppercase;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--border-radius);
}

button:hover, select:hover {
  background: var(--primary);
  color: #000;
}

.hint-btn {
  border-color: var(--warn);
  color: #333;
}

body.simple button:not(.lvl-btn):hover {
  background: #ddd;
}

body.simple .hint-btn {
  border-color: #d4af37;
  color: #b38f00;
}

body.dark-simple button:not(.lvl-btn),
body.dark-simple select {
  background: #3a3a3a;
  border: 1px solid #555;
  color: var(--primary);
}

body.dark-simple button:not(.lvl-btn):hover {
  background: #555;
  color: #fff;
}

body.dark-simple .hint-btn {
  border-color: var(--warn);
  color: var(--warn);
}

body.dark-simple .hint-btn:hover {
  background: var(--warn);
  color: #1a1a1a;
}

.icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- CHAT TERÜLET --- */
#chat-box {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0; /* Fontos flexbox görgetéshez */
}

#chat-box::-webkit-scrollbar {
  width: 8px;
}

#chat-box::-webkit-scrollbar-thumb {
  background: var(--primary);
}

.message {
  max-width: 85%;
  padding: 12px 18px;
  position: relative;
  word-wrap: break-word;
  border-radius: 4px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

.msg-tts-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  color: currentColor;
}

.msg-tts-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.msg-tts-btn .icon {
  width: 20px;
  height: 20px;
}

.message.user {
  align-self: flex-end;
  border-right: 3px solid var(--primary);
  text-align: right;
  background: rgba(255, 255, 255, 0.05);
}

.message.ai {
  align-self: flex-start;
  border-left: 3px solid var(--ai);
  color: var(--ai);
  background: rgba(0, 255, 255, 0.05);
}

.message.system {
  align-self: center;
  color: var(--warn);
  border: 1px dashed var(--warn);
  text-align: center;
  font-size: 0.9em;
}

/* Téma specifikus üzenetek */
body.simple .message.user {
  background: #eef2ff;
  border-right: 3px solid #0066cc;
  color: #333;
}

body.simple .message.ai {
  background: #f0f0f0;
  border-left: 3px solid #666;
  color: #333;
}

body.simple .message.system {
  color: #d4af37;
  border: 1px dashed #ccc;
}

body.dark-simple .message.user {
  background: #333;
  border-right: 3px solid var(--primary);
  color: var(--primary);
}

body.dark-simple .message.ai {
  background: #222;
  border-left: 3px solid var(--ai);
  color: var(--ai);
}

body.dark-simple .message.system {
  background: #2a2a2a;
  border: 1px dashed var(--warn);
  color: var(--warn);
}

/* --- INPUT AREA (CHAT BEVITEL) --- */
.input-area {
  padding: 10px 20px;
  border-top: 1px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.9);
  flex-wrap: nowrap;
  flex-shrink: 0; /* FONTOS: Ne nyomódjon össze az input terület */
}

body.simple .input-area {
  background: #fff;
  border-top: 1px solid #eee;
}

body.dark-simple .input-area {
  background: #2a2a2a;
  border-top: 1px solid #444;
}

input, textarea {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: white;
  font-family: inherit;
  font-size: 1.1rem;
  outline: none;
  padding: 0;
  min-height: 25px;
  height: auto;
  resize: none;
  overflow-y: hidden;
}

/* Mikrofon Gomb */
#mic-btn {
  padding: 8px;
  background: transparent;
  border: 1px solid var(--primary);
  margin-right: 5px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

#mic-btn .icon {
  width: 20px;
  height: 20px;
}

body.simple #mic-btn {
  border-color: #ccc;
  color: #333;
}

body.simple #mic-btn:hover {
  background: #eee;
}

body.dark-simple #mic-btn {
  border-color: #555;
  color: var(--primary);
  background: #3a3a3a;
}

#mic-btn.listening {
  background: var(--err) !important;
  border-color: var(--err) !important;
  color: #000 !important;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255, 51, 51, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 51, 51, 0); }
}

body.simple input, body.simple textarea { color: #333; }
body.dark-simple input, body.dark-simple textarea { color: var(--primary); }

/* --- MODAL ABLAKOK --- */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  background: #000;
  border: 2px solid var(--primary);
  padding: 25px;
  z-index: 20;
  display: none;
  box-shadow: 0 0 50px var(--primary);
  max-height: 85vh;
  overflow-y: auto;
}

body.simple .modal {
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  color: #333;
}

body.dark-simple .modal {
  background: #2a2a2a;
  border: 1px solid #555;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  color: var(--primary);
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9;
  display: none;
  backdrop-filter: blur(2px);
}

.shop-item {
  border: 1px dashed var(--primary);
  padding: 10px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hint-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--warn);
  margin-bottom: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.hint-option:hover {
  background: rgba(255, 215, 0, 0.1);
}

body.dark-simple .lb-controls {
  border-bottom: 1px solid #444;
}

.hint-cost-money { color: var(--warn); font-weight: bold; }
.hint-cost-energy { color: var(--ai); font-weight: bold; }

/* Ad Modal */
#ad-modal { text-align: center; border-color: var(--warn); }
#ad-progress-container { width: 100%; background: #333; height: 5px; margin: 15px 0; display: none; }
#ad-progress-bar { width: 0%; height: 100%; background: var(--warn); transition: width 1s linear; }
.ad-placeholder { background: #222; padding: 40px; margin: 10px 0; border: 1px dashed #666; color: #aaa; }

/* Login Screen */
#login-wrapper {
  position: absolute;
  z-index: 10;
  background: #000;
  border: 2px solid var(--primary);
  padding: 40px;
  text-align: center;
  box-shadow: 0 0 50px var(--primary);
}

body.simple #login-wrapper { background: #fff; border: 1px solid #ddd; }
body.dark-simple #login-wrapper { background: #2a2a2a; border: 2px solid #555; box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); }

/* Táblázatok */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
body.simple th, body.simple td { border-bottom: 1px solid #eee; }
th { color: var(--ai); text-transform: uppercase; font-size: 0.9em; }

.lb-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 10px;
}

#info-content h3 { color: var(--ai); border-bottom: 1px dashed var(--ai); padding-bottom: 5px; margin-top: 20px; }
#info-content ul { padding-left: 20px; }
#info-content li { margin-bottom: 5px; }
body.simple #info-content h3 { border-bottom: 1px solid #ccc; }
body.dark-simple #info-content h3 { border-bottom: 1px solid #444; }

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#char-count {
  color: var(--primary);
  font-family: var(--font-main);
  margin-right: 10px;
  font-weight: bold;
  transition: color 0.3s;
}
#char-count.warning { color: var(--warn); }
#char-count.limit { color: var(--err); text-shadow: 0 0 5px var(--err); }

/* --- AVATAR & ICONS --- */
.header-avatar-frame {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  overflow: hidden;
  background: #000;
  margin-right: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-avatar-frame img { width: 100%; height: 100%; object-fit: cover; }

.msg-content-wrapper { display: flex; align-items: center; gap: 10px; }
.msg-avatar { width: 40px; height: 40px; border-radius: 5px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--primary); flex-shrink: 0; }
.ai-avatar { border-color: var(--ai); order: -1; }
.user-avatar { border-color: var(--primary); order: 1; }

.system-icon {
  display: flex; justify-content: center; align-items: center;
  font-size: 20px; border: 1px dashed var(--warn); color: var(--warn);
}
.msg-text { flex-grow: 1; }
.message.user .msg-content-wrapper { justify-content: flex-end; text-align: right; }

/* --- HISTORY LOG --- */
.history-log-container {
  background-color: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--primary);
  padding: 15px;
  height: 400px;
  overflow-y: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.history-log-container::-webkit-scrollbar { width: 6px; }
.history-log-container::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.log-stream { display: flex; flex-direction: column; gap: 10px; }
.log-row { display: flex; flex-direction: column; max-width: 85%; margin-bottom: 5px; animation: fadeIn 0.3s ease-in-out; }
.log-index { font-size: 0.7em; opacity: 0.5; margin-bottom: 2px; letter-spacing: 1px; }
.log-bubble { padding: 8px 12px; border-radius: 2px; position: relative; line-height: 1.4; word-wrap: break-word; }

.log-row.user { align-self: flex-end; align-items: flex-end; text-align: right; }
.log-row.user .log-bubble { background: rgba(0, 255, 65, 0.1); border-right: 3px solid var(--primary); color: var(--primary); }
.log-row.user .log-author { display: block; font-size: 0.8em; opacity: 0.8; border-bottom: 1px dashed var(--primary); margin-bottom: 4px; padding-bottom: 2px; }

.log-row.ai { align-self: flex-start; align-items: flex-start; }
.log-row.ai .log-bubble { background: rgba(0, 229, 255, 0.1); border-left: 3px solid var(--ai); color: var(--ai); }
.log-row.ai .log-author { display: block; font-size: 0.8em; opacity: 0.8; border-bottom: 1px dashed var(--ai); margin-bottom: 4px; padding-bottom: 2px; }

.log-row.system { align-self: center; text-align: center; }
.log-row.system .log-bubble { background: rgba(255, 215, 0, 0.1); border: 1px dashed var(--warn); color: var(--warn); font-size: 0.9em; }

/* --- MULTIPLAYER GAME SCREEN (A JÁTÉK TÉR) --- */

#mp-waiting-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex; justify-content: center; align-items: center;
  z-index: 2000; flex-direction: column;
}

.waiting-box {
  text-align: center; color: var(--primary); font-family: var(--font-main);
  background: rgba(0, 0, 0, 0.9); border: 2px solid var(--primary);
  padding: 40px; border-radius: var(--border-radius); box-shadow: var(--box-shadow);
}
body.simple .waiting-box { background: #fff; border: 1px solid #ccc; color: #333; }
body.dark-simple .waiting-box { background: #2a2a2a; border: 1px solid #555; color: var(--primary); }

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1); border-top: 4px solid var(--primary);
  border-radius: 50%; width: 40px; height: 40px;
  animation: spin 1s linear infinite; margin: 20px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* A #mp-game-screen stílusainak teljes egyezése a #terminal-lal 
*/
#mp-game-screen {
  /* Méretek és pozíció: Ugyanaz mint a #terminal */
  width: 95%;
  max-width: 1000px;
  height: 90vh; /* Alapértelmezett */
  border: 2px solid var(--primary);
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  background: rgba(0, 0, 0, 0.85);
  
  /* Layout: Flex oszlop */
  display: flex;
  flex-direction: column;
  
  /* Ez már nem fixed overlay, hanem a 'helyére' lép */
  position: relative; 
  z-index: 100;
  
  font-family: var(--font-main);
  color: var(--primary);
  box-sizing: border-box;
}

@supports (height: 100dvh) {
  #mp-game-screen {
    height: 95dvh; /* Modern mobil böngészőknél */
  }
}

body.simple #mp-game-screen { background: #fff; border: 1px solid #ccc; color: #333; }
body.dark-simple #mp-game-screen { background: #2a2a2a; border: 1px solid #555; color: var(--primary); }

.mp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  padding: 10px 15px; 
  flex-shrink: 0; /* Fix magasság */
  background: rgba(0, 0, 0, 0.2);
}

body.simple .mp-header { border-bottom: 1px solid #ccc; background: #fff; }
body.dark-simple .mp-header { border-bottom: 1px solid #444; background: #2a2a2a; }

.exit-btn {
  background: rgba(255, 51, 51, 0.2); color: var(--err); border: 1px solid var(--err);
  padding: 5px 15px; cursor: pointer; border-radius: var(--border-radius);
  font-family: inherit; font-weight: bold; text-transform: uppercase; transition: 0.2s;
}
.exit-btn:hover { background: var(--err); color: #000; }

/* Ez a konténer felelős azért, hogy kitöltse a maradék helyet a fejléc alatt.
   Rekurzív flexbox struktúra a görgetéshez.
*/
.mp-mode-ui {
    flex: 1; /* Kitölti a maradék helyet */
    display: flex;
    flex-direction: column;
    min-height: 0; /* FONTOS: engedi a zsugorodást, hogy görgessen a belső */
    width: 100%;
    overflow: hidden; /* Nincs kifolyás */
}

/* Chat container inside mode UI */
.mp-chat-container {
    flex: 1; /* Kitölti a maradék helyet a progress bar alatt */
    display: flex;
    flex-direction: column;
    min-height: 0; /* FONTOS a belső görgetéshez */
    background: transparent;
    border: none;
}

/* A tényleges görgethető terület */
.mp-chat-box {
    flex: 1; /* Kitölti a rendelkezésre álló helyet */
    overflow-y: auto; /* CSAK ITT van görgetés */
    overflow-x: hidden;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mp-chat-box::-webkit-scrollbar { width: 8px; }
.mp-chat-box::-webkit-scrollbar-thumb { background: var(--primary); border-radius: var(--border-radius); }
body.simple .mp-chat-box::-webkit-scrollbar-thumb { background: #999; }
body.dark-simple .mp-chat-box::-webkit-scrollbar-thumb { background: #666; }

/* Üzenet stílusok */
.mp-message { padding: 8px 12px; border-radius: var(--border-radius); max-width: 80%; line-height: 1.4; word-wrap: break-word; }
.mp-system { color: var(--warn); font-style: italic; align-self: center; border: 1px dashed var(--warn); background: rgba(255, 215, 0, 0.05); text-align: center; width: 90%; }
.mp-user { background: rgba(0, 255, 65, 0.1); align-self: flex-end; border-right: 3px solid var(--primary); color: var(--primary); }
.mp-ai { background: rgba(0, 229, 255, 0.1); align-self: flex-start; border-left: 3px solid var(--ai); color: var(--ai); }

body.simple .mp-user { background: #eef2ff; border-right: 3px solid #0066cc; color: #333; }
body.simple .mp-ai { background: #f0f0f0; border-left: 3px solid #666; color: #333; }
body.simple .mp-system { background: #fffbf0; border: 1px dashed #d4af37; color: #b38f00; }
body.dark-simple .mp-user { background: #333; border-right: 3px solid var(--primary); color: var(--primary); }
body.dark-simple .mp-ai { background: #222; border-left: 3px solid var(--ai); color: var(--ai); }
body.dark-simple .mp-system { background: rgba(252, 211, 77, 0.1); border: 1px dashed var(--warn); color: var(--warn); }

/* Vezérlők (Input) - Fixen alul */
.mp-controls {
  display: flex;
  padding: 10px 15px;
  border-top: 1px solid var(--primary);
  gap: 10px;
  flex-shrink: 0; /* Sose nyomódjon össze */
  background: rgba(0, 0, 0, 0.9);
  min-height: 60px; /* Biztosítjuk a helyet */
  align-items: center;
}

body.simple .mp-controls { border-top: 1px solid #ccc; background: #fff; }
body.dark-simple .mp-controls { border-top: 1px solid #444; background: #2a2a2a; }

.mp-controls input {
  flex: 1;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 10px;
  font-family: inherit;
  border-radius: var(--border-radius);
  outline: none;
}

body.simple .mp-controls input { background: #fff; color: #333; border: 1px solid #ccc; }
body.dark-simple .mp-controls input { background: #1a1a1a; color: var(--primary); border: 1px solid #555; }

.mp-controls button {
  background: var(--primary); color: #000; border: none; padding: 0 20px;
  font-weight: bold; cursor: pointer; border-radius: var(--border-radius);
  font-family: inherit; text-transform: uppercase; transition: 0.2s; flex-shrink: 0;
  height: 40px;
}
.mp-controls button:hover { background: var(--ai); }
body.simple .mp-controls button { background: #0066cc; color: #fff; }
body.simple .mp-controls button:hover { background: #0052a3; }
body.dark-simple .mp-controls button { background: var(--primary); color: #000; }
body.dark-simple .mp-controls button:hover { background: var(--ai); }

/* Duel Progress & Sabotage */
#duel-progress { 
    display: flex; 
    gap: 20px; 
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--primary);
    flex-shrink: 0; 
}
body.simple #duel-progress { border-bottom: 1px solid #ccc; background: #f9f9f9; }
body.dark-simple #duel-progress { border-bottom: 1px solid #444; background: #222; }

.player-progress { flex: 1; }
.progress-bar { height: 10px; background: rgba(0, 0, 0, 0.5); width: 100%; margin-top: 5px; border: 1px solid var(--primary); border-radius: var(--border-radius); }
body.simple .progress-bar { background: #e0e0e0; border: 1px solid #ccc; }
body.dark-simple .progress-bar { background: #1a1a1a; border: 1px solid #555; }
.progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s; }

.sabotage-panel {
  display: flex; gap: 10px; padding: 10px; background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid var(--primary); 
  flex-shrink: 0; /* Ne nyomódjon össze */
}
body.simple .sabotage-panel { background: #f9f9f9; border-top: 1px solid #ccc; }
body.dark-simple .sabotage-panel { background: #2a2a2a; border-top: 1px solid #444; }

.sabotage-panel button {
  background: rgba(255, 51, 51, 0.2); color: var(--err); border: 1px solid var(--err);
  padding: 5px 10px; cursor: pointer; font-size: 0.8em; border-radius: var(--border-radius);
  font-family: inherit; font-weight: bold; text-transform: uppercase; transition: 0.2s;
  flex: 1; /* Egyenlő eloszlás */
}
.sabotage-panel button:hover { background: var(--err); color: #000; }

/* Lobby Specific Styles (FELJAVÍTVA) */
#multiplayer-modal {
    /* Szélesebb "Dashboard" nézet */
    max-width: 800px;
    background: rgba(10, 15, 20, 0.95);
    border: 2px solid var(--primary);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2), inset 0 0 50px rgba(0, 0, 0, 0.8);
}

body.simple #multiplayer-modal { background: #fff; border: 1px solid #ccc; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
body.dark-simple #multiplayer-modal { background: #2a2a2a; border: 1px solid #555; box-shadow: 0 0 30px rgba(0,0,0,0.5); }

#multiplayer-modal h2 {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--primary);
    font-size: 1.8em;
}

body.simple #multiplayer-modal h2 { color: #333; border-bottom: 1px solid #ccc; text-shadow: none; }
body.dark-simple #multiplayer-modal h2 { color: var(--primary); border-bottom: 1px solid #555; text-shadow: none; }

/* Tabs */
.lobby-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    margin-bottom: 20px;
    gap: 0; /* Összekapcsolt gombok */
}

.lobby-tab {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid transparent;
    border-bottom: none;
    color: var(--primary);
    opacity: 0.6;
    transition: all 0.3s;
    border-radius: 4px 4px 0 0;
    justify-content: center;
    padding: 12px;
    font-size: 1em;
}

.lobby-tab:hover {
    background: rgba(0, 255, 65, 0.1);
    opacity: 0.8;
}

.lobby-tab.active {
    border: 1px solid var(--primary);
    border-bottom: 1px solid #000; /* Hogy "összeolvadjon" a tartalommal */
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 255, 65, 0.1), transparent);
    text-shadow: 0 0 8px var(--primary);
    margin-bottom: -1px; /* Fontos az összeolvadáshoz */
    position: relative;
    z-index: 2;
}

body.simple .lobby-tab.active { background: #fff; border: 1px solid #ccc; border-bottom: 1px solid #fff; color: #0066cc; text-shadow: none; }
body.dark-simple .lobby-tab.active { background: #2a2a2a; border: 1px solid #555; border-bottom: 1px solid #2a2a2a; color: var(--primary); text-shadow: none; }

/* Room List Area */
#room-list {
    min-height: 250px;
    max-height: 400px;
    border: 1px solid var(--primary);
    background: rgba(0, 0, 0, 0.4);
    padding: 0;
    margin-bottom: 15px;
    overflow-y: auto;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* --- ÚJ: Csatlakozási konténer --- */
.mp-join-container {
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px;
}

.mp-join-container p {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: var(--ai);
}

.mp-join-container input {
    font-size: 1.5em !important; /* Nagyobb betűméret */
    text-align: center;
    letter-spacing: 3px;
    padding: 15px !important;
    border: 2px solid var(--primary);
    background: rgba(0,0,0,0.8);
    width: 80%;
    max-width: 300px;
    text-transform: uppercase;
}

.mp-join-container input::placeholder {
    letter-spacing: 1px;
    opacity: 0.5;
    font-size: 0.8em;
}

body.simple #room-list { background: #f9f9f9; border: 1px solid #ccc; box-shadow: inset 0 0 10px rgba(0,0,0,0.05); }
body.dark-simple #room-list { background: #222; border: 1px solid #444; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }

/* Table styling within room list */
.room-table {
    width: 100%;
    border-collapse: collapse;
}

.room-table th {
    text-align: left;
    color: var(--warn);
    background: rgba(0, 255, 65, 0.1);
    border-bottom: 2px solid var(--primary);
    padding: 12px;
    font-size: 0.9em;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
}

.room-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.1);
    color: #ddd;
}

.room-table tr:hover {
    background: rgba(0, 255, 65, 0.1);
    cursor: pointer;
}

/* Buttons styling enhancement */
.refresh-btn, .action-btn {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    font-size: 1.1em;
    letter-spacing: 1px;
    font-weight: bold;
    justify-content: center;
}

.refresh-btn {
    border-color: var(--ai);
    color: var(--ai);
    background: rgba(0, 229, 255, 0.1);
}

.refresh-btn:hover {
    background: var(--ai);
    color: #000;
    box-shadow: 0 0 20px var(--ai);
}

.action-btn {
    border-color: var(--warn);
    color: var(--warn);
    background: rgba(255, 215, 0, 0.1);
}

.action-btn:hover {
    background: var(--warn);
    color: #000;
    box-shadow: 0 0 20px var(--warn);
}

/* Bezárás gomb: mostantól igazodik a stílushoz (elsődleges szín, nem hiba) */
.close-btn {
    width: 100%;
    border-color: var(--primary);
    color: var(--primary);
    margin-top: 20px;
    padding: 10px;
    background: transparent;
    font-family: inherit;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid var(--primary);
}

.close-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary);
}

/* Form inputs styling in Create Tab - PROFIBB MEGJELENÉS */
.mp-form-row {
    margin-bottom: 20px;
}

.mp-form-row label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mp-input-group select, 
.mp-input-group input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--primary);
    color: var(--ai);
    font-family: var(--font-main);
    font-size: 1.1em;
    box-sizing: border-box; 
    border-radius: 4px;
    transition: all 0.3s;
}

.mp-input-group select:focus, 
.mp-input-group input:focus {
    outline: none;
    border-color: var(--warn);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    background: rgba(0, 0, 0, 0.9);
}

/* Settings Container - elkülönítve */
.mode-settings {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 4px;
    border-left: 2px solid var(--primary);
    margin-bottom: 20px;
}

/* Egyéb Panelek */
#analyst-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 15px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--ai); border-radius: var(--border-radius); margin-bottom: 15px; flex-shrink: 0; }
body.simple #analyst-dashboard { background: #f9f9f9; border: 1px solid #ccc; }
body.dark-simple #analyst-dashboard { background: #2a2a2a; border: 1px solid #555; }

/* Gauge Styles */
.gauge { width: 100%; height: 25px; background: rgba(0, 0, 0, 0.5); border: 2px solid var(--ai); border-radius: var(--border-radius); overflow: hidden; margin-bottom: 5px; }
.gauge-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--warn), var(--err)); transition: width 0.5s ease; }
#suspicion-value { color: var(--primary); font-weight: bold; font-size: 1.2em; }
#keywords-list { color: var(--warn); font-style: italic; min-height: 20px; }
#message-count { color: var(--ai); font-size: 1.5em; font-weight: bold; }
#analyst-tip { color: var(--primary); background: rgba(0, 255, 65, 0.05); padding: 10px; border-left: 3px solid var(--primary); margin: 0; }

#redblue-role-indicator { padding: 20px; margin-bottom: 20px; background: rgba(0, 217, 255, 0.1); border: 2px solid var(--ai); border-radius: var(--border-radius); text-align: center; flex-shrink: 0; }
#redblue-role-indicator h3 { margin: 0 0 10px 0; font-size: 1.5em; text-shadow: 0 0 10px currentColor; }

/* RESPONSIVE / MOBILE OPTIMIZATION */
@media (max-width: 1024px) {
  #terminal { width: 98%; height: 98vh; }
  /* A MP screen is ugyanígy igazodik */
  #mp-game-screen { width: 98%; height: 98vh; }
}

@media (max-width: 768px) {
  body { padding: 0; align-items: flex-start; }
  
  /* Mobilon TELJES KÉPERNYŐ (Full viewport) mindkettő */
  #terminal { width: 100%; height: 100dvh; border: none; border-radius: 0; }
  #mp-game-screen { width: 100%; height: 100dvh; border: none; border-radius: 0; }
  
  header { padding: 10px; gap: 5px; }
  .stats-bar { width: 100%; justify-content: space-between; order: 2; margin-top: 5px; font-size: 0.9em; }
  .level-selector { order: 1; flex-grow: 1; }
  .controls { order: 3; width: 100%; justify-content: space-between; gap: 5px; margin-top: 5px; }
  .controls button { flex-grow: 1; justify-content: center; padding: 8px 5px; font-size: 0.8em; }
  .controls button span { display: none; }
  #lang-btn span { display: inline; }
  .input-area { padding: 5px 10px; gap: 5px; }
  .input-area > span:first-child { display: none; }
  #user-input { font-size: 16px; min-width: 0; }
  #send-btn { padding: 8px 10px; white-space: nowrap; font-size: 0.9em; }
  #char-count { font-size: 0.7em; min-width: auto; margin-right: 5px; }
  
  .modal { width: 95%; padding: 15px; max-height: 90vh; }
  .hint-option { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hint-option > div { width: 100%; }
  .hint-option button { width: 100%; }

  /* Multiplayer responsive tweaks */
  #duel-progress { flex-direction: column; }
  #analyst-dashboard { grid-template-columns: 1fr; }
  .sabotage-panel { flex-direction: row; }
  .sabotage-panel button { width: auto; flex: 1; }
  
  /* Mobilon a paddinget levesszük, mert a konténer már eleve tele van */
  .mp-chat-box { padding: 10px; }
}

@media (max-width: 380px) {
  .stats-bar { flex-direction: column; align-items: flex-start; gap: 2px; }
  .energy-container { width: 100%; }
  .energy-bar-bg { width: 100%; }
}