:root {
  color-scheme: dark;
  --panel: rgba(16, 18, 24, .78);
  --line: rgba(255, 255, 255, .12);
  --text: #eef0f5;
  --dim: #a5adbd;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --warn: #f5b041;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0d12; color: var(--text);
  font: 14px/1.45 system-ui, "Segoe UI", sans-serif; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
button, input { font: inherit; color: var(--text); }
button { background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
button:hover { background: rgba(255,255,255,.14); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
input { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; }
input:focus { border-color: var(--accent); }

.overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(20,30,60,.55), rgba(5,6,10,.9)); }
.card { width: min(380px, 100%); background: #151821; border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.card h1 { margin: 0; font-size: 24px; }
.card p { margin: 0; color: var(--dim); }
.card label { display: flex; flex-direction: column; gap: 6px; color: var(--dim); }
.card .hint { font-size: 12px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.colors button.on { border-color: #fff; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.chip { position: absolute; top: 12px; left: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; color: var(--dim); backdrop-filter: blur(6px); }
.prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; backdrop-filter: blur(6px); text-align: center; }
.prompt kbd { background: #fff; color: #000; border-radius: 4px; padding: 1px 6px; font-weight: 700; margin-right: 6px; }
.panel { position: absolute; top: 12px; right: 12px; width: 260px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; backdrop-filter: blur(6px); }
.panel .title { font-weight: 700; }
.panel .sub { color: var(--dim); margin: 2px 0 10px; }
.panel .buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.focusbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 14px; backdrop-filter: blur(6px);
  max-width: calc(100% - 32px); flex-wrap: wrap; }
.stats { color: var(--dim); font: 12px ui-monospace, Consolas, monospace; }
#chat { position: absolute; left: 12px; bottom: 12px; width: min(380px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 6px; }
#chatLog { max-height: 180px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  text-shadow: 0 1px 2px #000; pointer-events: none; }
#chatLog div { background: rgba(0,0,0,.35); border-radius: 6px; padding: 2px 8px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
#chatLog b { color: var(--warn); }
#chatLog .sys { color: var(--dim); font-style: italic; }
.notice { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); background: var(--panel);
  border: 1px solid var(--warn); border-radius: 10px; padding: 8px 14px; }
.elevpanel { position: absolute; right: 12px; bottom: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 8px; width: 220px; }
.elevpanel .sub { color: var(--dim); }
.elevbuttons { display: flex; flex-direction: column; gap: 6px; }
.elevbuttons button { text-align: left; }
.elevbuttons button.lit { border-color: var(--warn); color: var(--warn); }
.elevbuttons button:disabled { opacity: .45; cursor: not-allowed; }
.hint { color: var(--dim); font-size: 12px; }
.card a, .hint a { color: var(--accent); }
body.focused #chat, body.focused #session, body.focused #prompt, body.focused #elevPanel, body.focused .topleft { display: none; }

/* join card on the right, avatar preview visible on the left */
.overlay.side { place-items: center end; background: linear-gradient(90deg, transparent 30%, rgba(5,6,10,.75)); }
@media (max-width: 760px) { .overlay.side { place-items: end center; background: linear-gradient(180deg, transparent 30%, rgba(5,6,10,.8)); } }
.lookpicker { display: flex; flex-direction: column; gap: 8px; }
.lookrow { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; }
.lookrow > span { color: var(--dim); font-size: 13px; }
.colors button { width: 26px; height: 26px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { padding: 4px 10px; font-size: 13px; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.topleft { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.topleft .chip { position: static; }
.chip.btn { color: var(--text); cursor: pointer; }
.chip.btn:hover { background: rgba(40,44,56,.9); }

.focusbar input { width: min(340px, 40vw); padding: 6px 10px; }
.focusbar { padding: 6px; gap: 8px; }

.card.account { width: min(460px, 100%); }
.cardhead { display: flex; justify-content: space-between; align-items: center; }
.cardhead h2 { margin: 0; font-size: 20px; }
.cardhead button { padding: 4px 10px; }
#accountBody { display: flex; flex-direction: column; gap: 10px; }
#accountBody p { margin: 0; color: var(--text); }
#accountBody p.hint { color: var(--dim); }
#accountBody p.ok { color: var(--ok); font-weight: 600; }
#accountBody p.bad { color: #ff8a9b; min-height: 1em; }
#accountBody ol { margin: 0; padding-left: 20px; color: var(--dim); display: flex; flex-direction: column; gap: 4px; }
.acct { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acct div { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
.acct span { color: var(--dim); font-size: 12px; }
.acct b { font-family: ui-monospace, Consolas, monospace; font-size: 18px; }
.acctform { display: flex; gap: 8px; }
.acctform input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }

.settingsCard, .adminCard { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.setrow { display: grid !important; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; color: var(--text) !important; }
.setrow select { font: inherit; color: var(--text); background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.setcheck { display: flex !important; flex-direction: row !important; gap: 10px; align-items: center; color: var(--text) !important; }
.overlay.blocker { z-index: 50; background: rgba(5,6,10,.82); }
#netStats { font: 12px ui-monospace, Consolas, monospace; }
#netStats:empty { display: none; }
.adminsec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.adminsec h3 { margin: 0; font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.arow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.arow .grow { flex: 1; min-width: 120px; }
.arow button { padding: 5px 10px; font-size: 13px; }
.arow input { padding: 5px 8px; font-size: 13px; }
.pill.warn { color: var(--warn); border-color: rgba(245,176,65,.5); }
.announce { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(79,140,255,.92); color: #fff;
  border-radius: 12px; padding: 10px 18px; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
@media (max-width: 600px) { .panel { top: auto; bottom: 240px; right: 12px; left: 12px; width: auto; } }

.card.account { max-height: calc(100vh - 32px); overflow: auto; }
.acctsec { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.acctsec h3 { margin: 0; font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.acctsec input { width: 100%; }
.acct b.plain { font-family: inherit; font-size: 15px; }
.pwchecks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--dim); }
.pwchecks li.ok { color: var(--ok); }
.acctsec input[type=checkbox] { width: auto; }
.acctsec .setcheck { font-size: 13px; color: var(--dim) !important; }
