/* Lobby and chat from the shared kit. A game sets these on :root (or any parent) to match
   its own look; the defaults are a neutral dark theme.

   --kit-bg      panel background          --kit-ink     text
   --kit-muted   quiet text                --kit-line    borders
   --kit-accent  main buttons, highlights  --kit-on-accent  text on the accent
   --kit-ok / --kit-warn                   --kit-font / --kit-display  fonts
   --kit-p0 … --kit-p5   player colours, by seat */

.kit-lobby, .kit-chat {
  --_bg: var(--kit-bg, #1d1a17); --_ink: var(--kit-ink, #f1e9dc); --_muted: var(--kit-muted, #a99c8a);
  --_line: var(--kit-line, #3d362f); --_acc: var(--kit-accent, #d29a3c); --_on: var(--kit-on-accent, #1d1a17);
  --_ok: var(--kit-ok, #8fbf6f); --_warn: var(--kit-warn, #e0875f);
  font-family: var(--kit-font, system-ui, sans-serif); color: var(--_ink);
}
.kit-lobby { background: var(--_bg); border: 1px solid var(--_line); border-radius: 12px; padding: 20px; max-width: 560px; }
.kit-lobby h3 { font-family: var(--kit-display, inherit); margin: 20px 0 8px; font-size: 1rem; letter-spacing: .02em; }
.kit-lobby button, .kit-lobby select, .kit-lobby input, .kit-chat button, .kit-chat input {
  font: inherit; color: var(--_ink); background: transparent; border: 1px solid var(--_line); border-radius: 8px; padding: 7px 12px; min-height: 36px;
}
.kit-lobby select option { background: var(--_bg); }
.kit-lobby button:hover:not(:disabled), .kit-chat button:hover { border-color: var(--_acc); }
.kit-lobby button:disabled { opacity: .45; }
.kit-lobby .kit-primary { background: var(--_acc); color: var(--_on); border-color: var(--_acc); font-weight: 600; }
.kit-lobby .kit-quiet { border-color: transparent; color: var(--_muted); margin-left: auto; }
.kit-muted { color: var(--_muted); font-size: .9em; }
.kit-label { color: var(--_muted); font-size: .8em; text-transform: uppercase; letter-spacing: .08em; }
.kit-code { font-family: var(--kit-display, ui-monospace, monospace); font-size: 2.4rem; letter-spacing: .18em; line-height: 1.1; margin: 2px 0 10px; }
.kit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kit-actions { margin-top: 20px; }
.kit-lobby-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.kit-qr { margin: 0; text-align: center; }
.kit-qr svg { display: block; border-radius: 6px; }
.kit-qr figcaption { color: var(--_muted); font-size: .75em; margin-top: 4px; }
.kit-seats { list-style: none; margin: 0; padding: 0; }
.kit-seats li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--_line); flex-wrap: wrap; }
.kit-seats li.away .kit-name { opacity: .55; }
.kit-seats li.board { opacity: .6; }
.kit-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid rgb(0 0 0 / .3);
  background: var(--kit-p0, #c8553d); }
.kit-dot.p1 { background: var(--kit-p1, #3d7cc8); }
.kit-dot.p2 { background: var(--kit-p2, #d8b13a); }
.kit-dot.p3 { background: var(--kit-p3, #7a4f9c); }
.kit-dot.p4 { background: var(--kit-p4, #4e9a5f); }
.kit-dot.p5 { background: var(--kit-p5, #d97a2b); }
.kit-dot.none { background: transparent; }
.kit-name { font-weight: 600; }
.kit-tags { display: flex; gap: 6px; align-items: center; flex: 1; }
.kit-tags em, .kit-seats em { font-style: normal; font-size: .8em; color: var(--_muted); border: 1px solid var(--_line); border-radius: 99px; padding: 1px 8px; }
.kit-tags .kit-ok { color: var(--_ok); border-color: currentColor; }
.kit-tags .kit-warn { color: var(--_warn); border-color: currentColor; }
.kit-x { border-color: transparent !important; color: var(--_muted); padding: 4px 8px !important; }
.kit-field { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0; }
.kit-check { display: flex; justify-content: flex-start; gap: 8px; align-items: center; margin: 10px 0; color: var(--_muted); }
.kit-settings { display: grid; }

/* chat */
.kit-chat-btn { position: fixed; right: 16px; bottom: 16px; z-index: 50; background: var(--_bg) !important; border-radius: 50% !important; width: 48px; height: 48px; padding: 0 !important; font-size: 20px; }
.kit-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--_acc); color: var(--_on); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.kit-chat-panel { position: fixed; right: 16px; bottom: 76px; z-index: 50; width: min(340px, calc(100vw - 32px)); max-height: 60vh; display: flex; flex-direction: column;
  background: var(--_bg); border: 1px solid var(--_line); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .4); }
.kit-chat-panel[hidden], .kit-toast[hidden], .kit-badge[hidden] { display: none; }
.kit-chat-panel header { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--_line); font-weight: 600; }
.kit-chat-panel ol { list-style: none; margin: 0; padding: 10px 14px; overflow-y: auto; flex: 1; display: grid; gap: 6px; align-content: start; }
.kit-chat-panel li.mine b { color: var(--_acc); }
.kit-chat-panel form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--_line); }
.kit-chat-panel form input { flex: 1; min-width: 0; }
.kit-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 120px);
  background: var(--_bg); border: 1px solid var(--_line); border-radius: 99px; padding: 8px 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 600px) {
  .kit-lobby { padding: 16px; border-radius: 0; border-width: 1px 0; }
  .kit-chat-panel { right: 0; left: 0; bottom: 0; width: auto; border-radius: 12px 12px 0 0; max-height: 70vh; }
  .kit-lobby-head { flex-direction: column; }
}
