/* css/lobby.css — chat panel, name picker, lobby browser, reconnect toast */

/* ── Chat panel ─────────────────────────────────────────────────────── */
.chat-panel {
  position: fixed;
  right: 0;
  top: 80px;
  bottom: 80px;
  width: 320px;
  z-index: 7000;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  pointer-events: none;
}
.chat-panel .chat-inner {
  background: #f4eedc;
  border: 2px solid #3a3028;
  border-right: none;
  border-radius: 8px 0 0 8px;
  box-shadow: -3px 3px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  flex: 1;
  transition: transform 220ms ease;
  pointer-events: auto;
}
.chat-panel.collapsed .chat-inner {
  transform: translateX(calc(100% + 8px));
}
.chat-toggle {
  align-self: flex-start;
  margin-top: 0;
  margin-right: 4px;
  background: #3a3028;
  color: #f4eedc;
  border: 2px solid #3a3028;
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 10px 8px;
  font-size: 16px;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  min-height: 44px;
  min-width: 38px;
}
.chat-unread {
  display: inline-block;
  background: #c04040;
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  padding: 1px 6px;
  margin-left: 2px;
  font-weight: 700;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #3a3028;
  color: #f4eedc;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 2px;
  border-radius: 6px 0 0 0;
}
.chat-collapse {
  background: transparent;
  color: #f4eedc;
  border: none;
  font-size: 14px;
  cursor: pointer;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #2a221c;
  background: #faf5e6;
}
.chat-msg {
  margin-bottom: 4px;
  word-wrap: break-word;
}
.chat-msg .chat-time {
  color: #a09080;
  font-size: 10px;
  margin-right: 4px;
}
.chat-msg .chat-name {
  font-weight: 700;
  color: #604030;
  margin-right: 4px;
}
.chat-msg .chat-text {
  color: #2a221c;
}
.chat-msg.chat-system {
  color: #806040;
  font-style: italic;
  font-size: 11px;
  text-align: center;
  padding: 2px 0;
  opacity: 0.85;
}
.chat-form {
  display: flex;
  border-top: 1px solid #c4b890;
  background: #f4eedc;
}
.chat-input {
  flex: 1;
  border: none;
  padding: 10px 8px;
  font-size: 13px;
  background: transparent;
  outline: none;
  color: #2a221c;
}
.chat-send {
  background: #3a7030;
  color: #fff;
  border: none;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0 0 0 0;
}
.chat-send:hover { background: #4a8038; }

/* Mobile: bottom-sheet style — clears the mobile bottom nav */
@media (max-width: 720px) {
  .chat-panel {
    top: auto;
    bottom: var(--mobile-safe-bottom, 0px);
    right: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    height: 60svh;
    flex-direction: column-reverse;
  }
  .chat-panel .chat-inner {
    border: 2px solid #3a3028;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    transform: translateY(0);
  }
  .chat-panel.collapsed .chat-inner {
    transform: translateY(calc(100% + 4px));
  }
  .chat-toggle {
    align-self: flex-end;
    margin: 0 12px -2px 0;
    border-radius: 8px 8px 0 0;
    border: 2px solid #3a3028;
    border-bottom: none;
  }
}

/* ── Name picker ────────────────────────────────────────────────────── */
.name-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.65);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.name-picker-modal {
  background: #f4eedc;
  border: 2px solid #3a3028;
  border-radius: 10px;
  padding: 26px 32px;
  text-align: center;
  min-width: 280px;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.np-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  letter-spacing: 3px;
  color: #3a3028;
  margin-bottom: 6px;
}
.np-sub {
  font-size: 12px;
  color: #706050;
  margin-bottom: 16px;
}
.np-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #c4b890;
  border-radius: 4px;
  background: #fffcf2;
  color: #2a221c;
  outline: none;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.np-save {
  min-width: 140px;
}

/* ── Lobby browser ──────────────────────────────────────────────────── */
.lobby-browser-list {
  max-width: 600px;
  margin: 14px auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lobby-browser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #faf5e6;
  border: 1px solid #c4b890;
  border-radius: 6px;
  padding: 10px 14px;
  gap: 10px;
}
.lbr-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: left;
}
.lbr-host {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: #3a3028;
  letter-spacing: 1px;
}
.lbr-meta {
  font-size: 11px;
  color: #806040;
  margin-top: 2px;
}
.lbr-actions {
  display: flex;
  gap: 6px;
}
.lbr-btn {
  background: #3a5078;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
}
.lbr-btn:hover { background: #4a609a; }
.lbr-btn.spec {
  background: #6a5040;
}
.lbr-btn[disabled] {
  background: #999;
  cursor: not-allowed;
  opacity: 0.6;
}
.lobby-browser-empty {
  text-align: center;
  color: #806040;
  padding: 30px 10px;
  font-style: italic;
}

/* ── Reconnect toast ────────────────────────────────────────────────── */
.reconnect-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #c04040;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  z-index: 9500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  letter-spacing: 1px;
}
