/* ============================================
   BattleCrypt - Lobby, room and chat
   The platform lobby kit drawn in the tavern style (lobby-ui.js,
   room-ui.js, match-chat.js). Text here is never below 11px; the older
   lobby and room rules that were smaller are raised at the end.
   ============================================ */

/* ---- Play menu ---- */
.lobby-top { flex-wrap: wrap; }
.lobby-actions { flex-wrap: wrap; justify-content: flex-end; }
.menu-btn.lk-primary {
  background: linear-gradient(180deg, #6a4a10 0%, #2a1a04 100%);
  border-color: #ffcc00;
  color: #ffe08a;
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.25);
}
.menu-btn.lk-primary:hover { box-shadow: 0 0 18px rgba(255, 204, 0, 0.45); }

.lk-panel {
  background: #0d0800;
  border: 2px solid #554422;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.lk-panel.hidden { display: none; }
.lk-vis-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0 12px;
}
@media (max-width: 700px) { .lk-vis-options { grid-template-columns: 1fr; } }
.lk-vis {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #1a1008;
  border: 1px solid #332200;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.lk-vis:hover { border-color: #aa7722; }
.lk-vis:has(input:checked) { border-color: #ffcc00; background: #2a1a08; }
.lk-vis input { position: absolute; opacity: 0; pointer-events: none; }
.lk-vis:has(input:focus-visible) { outline: 2px solid #ffcc00; outline-offset: 2px; }
.lk-vis-name { font-size: 12px; font-weight: 700; color: #ffcc00; letter-spacing: 1px; }
.lk-vis-desc { font-size: 11px; color: #aa8855; line-height: 1.4; }

.lk-input {
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 12px;
  background: #1a1008;
  border: 2px solid #554422;
  color: #ffcc00;
  outline: none;
}
.lk-input:focus { border-color: #ff9900; }
.lk-input.hidden { display: none; }
.lk-code-input { width: 140px; text-transform: uppercase; letter-spacing: 2px; }
.lk-row { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.lk-panel .lk-row { justify-content: flex-start; }
.lk-join-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.lk-label { font-family: var(--font-ui); font-size: 11px; color: #aa8855; letter-spacing: 1px; }
.lk-spacer { flex: 1; }
.lk-list-title { text-align: left; margin: 4px 0 8px; }
.lk-prompt-text { font-family: var(--font-ui); font-size: 12px; color: #bbb; margin: 8px 0; }
.lk-prompt-code { font-family: var(--font-ui); font-size: 13px; color: #ffcc00; margin: 6px 0; font-weight: 700; letter-spacing: 2px; }

.lobby-item { gap: 12px; }
.lobby-item:focus-visible { outline: 2px solid #ffcc00; outline-offset: 2px; }
.lobby-item.locked-out { opacity: 0.5; cursor: not-allowed; }
.lobby-item.locked-out:hover { background: #1a1008; border-color: #332200; }
.lk-item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; }
.lk-blurb { font-family: var(--font-ui); font-size: 11px; color: #aa8855; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-item-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lobby-item .lobby-players, .lobby-item .lobby-bots { font-size: 11px; }

/* ---- Marks: Host, Ready, Away, Bot ---- */
.lk-marks { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; min-height: 4px; margin-bottom: 4px; }
.lk-mark {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1px 6px;
  border-radius: 2px;
  background: #333;
  color: #ddd;
  white-space: nowrap;
}
.lk-mark.host { background: #ffcc00; color: #1a1000; }
.lk-mark.bot { background: #ff8800; color: #000; }
.lk-mark.away { background: #3a2a2a; color: #ffaaaa; }
.lk-mark.ready { background: #1f3a1f; color: #88ff88; }

/* ---- Room ---- */
.lk-room-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -6px 0 14px;
  font-family: var(--font-ui);
}
.lk-room-label { font-size: 11px; color: #aa88cc; letter-spacing: 1px; }
.lk-room-code {
  font-size: 18px;
  font-weight: 700;
  color: #ffcc00;
  letter-spacing: 3px;
  text-shadow: 0 0 8px rgba(255, 153, 0, 0.5);
  user-select: all;
}
.lk-room-vis {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #cc99ff;
  border: 1px solid #443366;
  padding: 3px 8px;
  border-radius: 2px;
}
.lk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #ffcc00;
  letter-spacing: 1px;
  cursor: pointer;
}
.lk-toggle.hidden { display: none; }
.lk-toggle input { width: 16px; height: 16px; accent-color: #ffcc00; cursor: pointer; }
.lk-countdown {
  font-family: var(--font-display);
  font-size: 16px;
  color: #ffcc00;
  text-shadow: 0 0 10px #ff9900;
  margin-bottom: 12px;
}
.lk-countdown.hidden { display: none; }
.lk-room-status {
  font-family: var(--font-ui);
  font-size: 12px;
  color: #aa88cc;
  min-height: 18px;
  margin-bottom: 10px;
}
.lk-room-status.error { color: #ff6666; }
.lk-actions { display: flex; gap: 4px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.lk-mini {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  background: #1a1020;
  border: 1px solid #554477;
  color: #ccbbee;
  border-radius: 2px;
  cursor: pointer;
}
.lk-mini:hover { border-color: #ccbbee; }
.lk-mini:focus-visible { outline: 2px solid #ffcc00; outline-offset: 1px; }
.lk-mini.danger { border-color: #993333; color: #ff8888; }
.lk-mini:disabled { opacity: 0.55; cursor: default; }
.lk-mini.danger:hover { border-color: #ff6666; }
.lk-confirm { font-family: var(--font-ui); font-size: 11px; color: #ff8888; font-weight: 700; }
.color-swatch { padding: 0; }
.color-swatch:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Older lobby and room text raised to the 11px floor */
.room-player, .room-player .rp-name, .room-player .rp-class, .room-player .rp-status,
.class-special, .color-picker-label, .rp-bot-tag, .bot-select, .lobby-item .lobby-bots,
.player-info-panel label, .connection-status { font-size: 11px; }

/* ---- In-match chat ---- */
.match-chat {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  z-index: 40;
  pointer-events: none;
  font-family: var(--font-ui);
}
.match-chat.hidden { display: none; }
.match-chat-log {
  max-height: 180px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
  color: #ddd;
  text-shadow: 0 1px 2px #000;
  padding: 6px 8px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
.match-chat-log.fresh, .match-chat.open .match-chat-log { opacity: 1; }
.match-chat.open .match-chat-log { background: rgba(10, 5, 20, 0.82); pointer-events: auto; }
.match-chat-log .chat-msg.mine .chat-name { color: #88ddff; }
.match-chat-entry { pointer-events: auto; margin-top: 6px; }
.match-chat-entry.hidden { display: none; }
.match-chat-entry .chat-input { width: 100%; box-sizing: border-box; border: 2px solid #443366; font-size: 12px; }
.match-chat-hint {
  margin-top: 4px;
  text-align: right;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 1px;
}
.match-chat.open .match-chat-hint { display: none; }
.match-chat-unread {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: #ffcc00;
  color: #1a1000;
  font-weight: 700;
  text-align: center;
}
.match-chat-unread.hidden { display: none; }
@media (prefers-reduced-motion: reduce) { .match-chat-log { transition: none; } }

/* ---- Network notes in the match ---- */
.net-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffcc88;
  background: rgba(20, 10, 0, 0.8);
  border: 1px solid #aa7722;
  padding: 4px 12px;
  border-radius: 3px;
  pointer-events: none;
}
.net-banner.hidden { display: none; }
.hmo-leave { margin-top: 14px; pointer-events: auto; }
.hmo-leave.hidden, .hmo-spinner.hidden { display: none; }
.hmo-subtitle { max-width: 420px; margin-left: auto; margin-right: auto; }
