/* Shared look of the lobby (lobby.html) and the deck builder (decks.html): dark glass panels over a dimmed
   Middle-earth background, gold for the main action, Cinzel for titles — the same palette as the table. */
:root {
  color-scheme: dark;
  --bg: #0d0f10;
  --panel: rgba(17, 20, 22, .86);
  --panel2: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .16);
  --text: #eef1ee;
  --muted: #9aa6a1;
  --gold: #f0b43c;
  --gold2: #e0960a;
  --good: #5ad28a;
  --bad: #ff6b5e;
  --blue: #7cc4ff;
  --radius: 16px;
  --W: #f3edc7; --U: #8ec5f0; --B: #a898a0; --R: #f08a6a; --G: #8fcf8a; --C: #c9c3bb;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg) url(../images/backgrounds/erebor-hall.webp) center / cover fixed;
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
body::before { content: ''; position: fixed; inset: 0; background: linear-gradient(180deg, rgba(8, 9, 10, .72), rgba(8, 9, 10, .9)); z-index: -1; }
a { color: var(--gold); }
h1, h2, h3 { margin: 0; }
.cinzel, h1, h2 { font-family: Cinzel, Georgia, serif; letter-spacing: .02em; }
[hidden] { display: none !important; }
.grow { flex: 1; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: rgba(10, 11, 12, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .brand { font-family: Cinzel, Georgia, serif; font-weight: 900; font-size: 19px; color: var(--gold); text-decoration: none; letter-spacing: .04em; white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 7px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.topbar nav a:hover { background: var(--panel2); }
.topbar nav a.on { background: rgba(240, 180, 60, .14); color: var(--gold); }
.topbar .grow { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; }
.me .av { width: 28px; height: 28px; }
.me span { font-weight: 700; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* avatars: first letter on a color from the name */
.av { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-weight: 800; color: #1a1300; background: hsl(var(--h, 40) 70% 62%); flex: none; text-transform: uppercase; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); backdrop-filter: blur(8px); }
.panel > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.panel > header h2 { font-size: 17px; }
.panel > header .sub { color: var(--muted); font-size: 12.5px; }
.panel .body { padding: 14px 18px 18px; }

/* buttons & inputs */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, transform .08s, box-shadow .15s; }
.b:hover { background: rgba(255, 255, 255, .09); }
.b:active { transform: translateY(1px); }
.b:disabled { opacity: .45; cursor: not-allowed; }
.b.gold { border: 0; background: linear-gradient(#ffc94a, var(--gold2)); color: #2a1a00; box-shadow: 0 2px 0 #8a5a00, 0 6px 16px rgba(0, 0, 0, .35); }
.b.gold:hover { background: linear-gradient(#ffd466, #eaa21a); }
.b.big { min-height: 48px; font-size: 16px; padding: 0 22px; border-radius: 13px; }
.b.small { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; }
.b.good { border-color: rgba(90, 210, 138, .5); color: var(--good); }
.b.danger { color: var(--bad); border-color: rgba(255, 107, 94, .35); }
.b.icon { width: 34px; min-height: 34px; padding: 0; }
input[type=text], input[type=search], input[type=password], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: rgba(0, 0, 0, .35); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; min-height: 38px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(240, 180, 60, .7); box-shadow: 0 0 0 3px rgba(240, 180, 60, .18); }
select option, select optgroup { background: #1b1e20; }
label.field { display: grid; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--muted); cursor: pointer; }
.muted { color: var(--muted); }
.err { color: var(--bad); }

/* mana symbols as colored dots */
.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pip { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.pip.W { background: var(--W); } .pip.U { background: var(--U); } .pip.B { background: var(--B); } .pip.R { background: var(--R); } .pip.G { background: var(--G); } .pip.C { background: var(--C); }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toasts div { padding: 10px 16px; border-radius: 12px; background: rgba(28, 30, 32, .96); border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-weight: 600; animation: toastin .2s ease-out; }
.toasts div.bad { border-color: rgba(255, 107, 94, .6); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* chat (lobby + waiting room) */
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat ol { flex: 1; min-height: 120px; overflow-y: auto; list-style: none; margin: 0; padding: 12px 18px; display: flex; flex-direction: column; gap: 7px; }
.chat li { overflow-wrap: anywhere; line-height: 1.4; }
.chat li b { margin-right: 5px; }
.chat li time { color: var(--muted); font-size: 11px; margin-left: 4px; }
.chat li.sys { color: var(--muted); font-size: 12.5px; font-style: italic; }
.chat li.me b { color: var(--blue); }
.chat form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.chat form input { flex: 1; min-width: 0; }
.chat .empty { color: var(--muted); font-style: italic; }

/* connection */
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.conn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.conn.off::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

@media (max-width: 720px) {
  .topbar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .topbar nav a { padding: 6px 8px; }
  .me span { max-width: 90px; }
}
