/* fheroes2 multiplayer lobby overlay */

#lobby {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  color: #ddd;
  font-family: "Roboto", system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

#lobby[hidden] { display: none; }

.lobby-card {
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 28px 32px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lobby-card h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  color: #fff;
  font-weight: 500;
}

.lobby-card .subtitle {
  margin: 0 0 20px;
  color: #888;
  font-size: 0.9rem;
}

.lobby-card h2 {
  margin: 16px 0 6px;
  font-size: 0.85rem;
  color: #6cf;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lobby-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lobby-actions button {
  flex: 1;
  min-width: 140px;
  background: #2a5;
  color: #fff;
  border: 0;
  padding: 14px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  transition: background 0.1s;
}

.lobby-actions button:hover { background: #3b6; }
.lobby-actions button.secondary { background: #444; }
.lobby-actions button.secondary:hover { background: #555; }
.lobby-actions button:disabled { background: #333; color: #777; cursor: not-allowed; }

.lobby-field { margin: 8px 0; }
.lobby-field label { display: block; font-size: 0.8rem; color: #aaa; margin-bottom: 4px; }
.lobby-field input,
.lobby-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: #0d0d0d;
  color: #ddd;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 8px;
  font-family: monospace;
  font-size: 12px;
}
.lobby-field textarea { min-height: 90px; resize: vertical; }

.room-code {
  font-family: monospace;
  font-size: 1.8rem;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 12px;
  background: #0d0d0d;
  border-radius: 4px;
  color: #6cf;
  user-select: all;
  cursor: copy;
}

#lobby-status {
  margin-top: 12px;
  padding: 8px 12px;
  background: #0d0d0d;
  border-left: 3px solid #6cf;
  font-size: 0.85rem;
  color: #aaa;
  min-height: 1.2em;
}

.lobby-step[hidden] { display: none; }

#turn-banner {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 0.85rem;
  border-radius: 4px;
  pointer-events: none;
}

#turn-banner[hidden] { display: none; }

#guest-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
  z-index: 10;
}

/* Waiting state for the turn banner: shown to whichever side may not act right now. */
#turn-banner.waiting {
  background: rgba(120, 60, 20, 0.85);
}

/* Host-side control bar. Deliberately outside the engine canvas so the input gate never
   intercepts it -- "Take control back" has to work while the guest holds control. */
#fh2-net-ui {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #333;
  border-radius: 6px;
  font-family: "Roboto", system-ui, sans-serif;
  font-size: 0.8rem;
  color: #ddd;
}

#fh2-net-ui[hidden] { display: none; }

#fh2-net-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: #1f5c2e;
  color: #fff;
  white-space: nowrap;
}

#fh2-net-pill.inactive { background: #7a3d12; }

#fh2-net-ui button {
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

#fh2-net-ui button[hidden] { display: none; }

#fh2-net-ui .hint { color: #666; font-size: 0.72rem; }

/* ---- one-time game data setup ---- */

.lobby-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: #777;
  line-height: 1.5;
}

.lobby-note code {
  background: #1c1c1c;
  padding: 1px 4px;
  border-radius: 3px;
}

#asset-drop {
  margin-top: 14px;
  padding: 22px 16px;
  border: 2px dashed #3a3a3a;
  border-radius: 8px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

#asset-drop.over {
  border-color: #6a9a4a;
  background: rgba(106, 154, 74, 0.08);
}

#asset-drop p { margin: 4px 0; }

.file-button {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 16px;
  background: #2f2f2f;
  border: 1px solid #4a4a4a;
  border-radius: 5px;
  cursor: pointer;
}

.file-button:hover { background: #3a3a3a; }

.file-button input[type=file] { display: none; }

#asset-progress {
  width: 100%;
  margin-top: 14px;
  height: 10px;
}

#asset-status {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #aaa;
  min-height: 1.2em;
}

#btn-sound {
  position: fixed;
  top: 8px;
  right: 10px;
  z-index: 60;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

#btn-sound[hidden] { display: none; }
