/* ============================================================
   Online lobby, auth, rooms, friends. Same ink & flame vocabulary.
   ============================================================ */

.screen--online [hidden],
.screen--room [hidden],
.screen--profile [hidden],
.screen--create [hidden],
.screen--join [hidden],
.screen--leave [hidden],
.invite-stack [hidden] { display: none !important; }

.screen--online,
.screen--room {
  display: flex;
  flex-direction: column;
  padding: 2.8cqh 3.4cqw;
  background:
    radial-gradient(90% 120% at 15% 0%, rgba(111, 179, 184, .08), transparent 55%),
    linear-gradient(180deg, rgba(5, 6, 7, .9), rgba(6, 7, 8, .84) 40%, rgba(5, 6, 7, .96));
}

.online-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.4cqw;
  padding-bottom: 1.4cqh;
  border-bottom: 1px solid rgba(236, 228, 210, .16);
  flex: 0 0 auto;
}
.online-brand { text-align: center; }
.online-brand .eyebrow { margin-bottom: .15em; }
.online-brand h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(22px, 2.2cqw, 34px);
  font-weight: 700;
  letter-spacing: .18em;
}
.online-user {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .6em;
  min-width: 0;
}
.online-user[hidden] { display: none; }
.online-user-copy { display: flex; flex-direction: column; min-width: 0; }
.online-user-copy b {
  font-family: var(--f-display);
  font-size: clamp(14px, 1.1cqw, 18px);
  letter-spacing: .1em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11em;
}
.online-user-copy small {
  font-family: var(--f-cond);
  font-size: clamp(8px, .65cqw, 11px);
  letter-spacing: .1em;
  color: var(--paper-dim);
  opacity: .65;
  white-space: nowrap;
}
.online-conn {
  justify-self: start;
  font-family: var(--f-cond);
  font-size: clamp(9px, .72cqw, 12px);
  letter-spacing: .16em;
  color: #c9a67a;
}
.online-conn.is-on { color: #8fc9c5; }
.online-conn.is-off { color: #d07f72; }

/* ---------- avatars ---------- */
.online-avatar,
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.8em;
  height: 2.8em;
  overflow: hidden;
  border: 1px solid rgba(236, 228, 210, .35);
  background: radial-gradient(circle at 35% 30%, #3b4549, #141819 75%);
  font-family: var(--f-display);
  font-size: clamp(12px, 1cqw, 16px);
  color: var(--paper);
  font-style: normal;
  vertical-align: middle;
}
.online-avatar img,
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar b { position: relative; z-index: 0; font-weight: 400; opacity: .8; }
.avatar--lg { width: clamp(84px, 8cqw, 130px); height: clamp(84px, 8cqw, 130px); font-size: clamp(28px, 3cqw, 46px); }
.avatar--md { width: clamp(48px, 4.2cqw, 64px); height: clamp(48px, 4.2cqw, 64px); }
.avatar--sm { width: 2.2em; height: 2.2em; font-size: clamp(10px, .8cqw, 13px); }

/* ---------- auth ---------- */
.auth-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 430px) 1fr;
  align-items: center;
  gap: 5cqw;
  padding: 3cqh 4cqw;
}
.auth-card {
  position: relative;
  padding: 2.2cqw 2.2cqw 1.8cqw;
  color: var(--ink);
  background:
    radial-gradient(120% 100% at 85% 0%, rgba(255, 252, 242, .9), transparent 50%),
    var(--paper);
  clip-path: polygon(0 1%, 98.5% 0, 100% 97.5%, 1.5% 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(53, 59, 62, .2);
  pointer-events: none;
}
.auth-tabs {
  display: flex;
  gap: 1.8em;
  border-bottom: 1px solid rgba(53, 59, 62, .25);
  margin-bottom: 1.3em;
}
.auth-tabs button {
  padding: .45em 0 .55em;
  font-family: var(--f-display);
  font-size: clamp(18px, 1.6cqw, 26px);
  letter-spacing: .14em;
  color: #777267;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tabs button.is-active { color: var(--ink); border-color: var(--red); }
.auth-form { display: flex; flex-direction: column; gap: .75em; }
.auth-form[hidden] { display: none; }
.auth-form label,
.online-form label {
  display: flex;
  flex-direction: column;
  gap: .32em;
  font-size: clamp(10px, .78cqw, 13px);
  letter-spacing: .1em;
  color: #55534b;
}
.auth-form input,
.online-form input,
.online-form select,
.room-search input,
.add-friend input,
.host-tools input,
.host-tools select {
  width: 100%;
  min-height: 2.4em;
  padding: .35em .55em;
  border: 1px solid rgba(53, 59, 62, .3);
  background: rgba(255, 255, 255, .4);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: clamp(12px, .95cqw, 15px);
  border-radius: 0;
  outline: none;
}
.auth-form input:focus,
.online-form input:focus,
.online-form select:focus,
.room-search input:focus,
.add-friend input:focus,
.host-tools input:focus,
.host-tools select:focus {
  border-color: var(--red);
  background: rgba(255, 255, 255, .65);
}
.code-row { display: flex; align-items: center; gap: .6em; }
.code-row input { flex: 1; min-width: 0; }
.code-row .text-btn { white-space: nowrap; color: var(--red-deep); border-color: rgba(142, 36, 27, .4); }
.auth-error { min-height: 1.4em; margin: 0; font-size: clamp(10px, .75cqw, 12px); color: var(--red-deep); letter-spacing: .04em; }
.auth-form .brush-btn { align-self: flex-start; margin-top: .3em; background: var(--ink); color: var(--paper); }
.auth-form .brush-btn i { color: var(--amber); }
.auth-note {
  margin: 1.1em 0 0;
  padding-top: .8em;
  border-top: 1px solid rgba(53, 59, 62, .16);
  font-size: clamp(9px, .68cqw, 11px);
  line-height: 1.8;
  color: #726d61;
  letter-spacing: .04em;
}
.auth-note b { color: var(--red-deep); }
.auth-aside {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1.2em;
  text-align: right;
  opacity: .8;
}
.auth-vertical {
  writing-mode: vertical-rl;
  font-family: var(--f-display);
  font-size: clamp(44px, 5.6cqw, 100px);
  letter-spacing: .25em;
  color: rgba(236, 228, 210, .82);
  line-height: 1;
}
.auth-aside-line { width: 1px; height: 9cqh; background: linear-gradient(180deg, var(--red), transparent); }
.auth-aside p { margin: 0; font-family: var(--f-cond); letter-spacing: .3em; font-size: clamp(9px, .72cqw, 12px); color: var(--paper-dim); }
.auth-aside small { font-size: clamp(9px, .7cqw, 12px); line-height: 1.9; color: rgba(236, 228, 210, .45); letter-spacing: .06em; }

/* ---------- lobby ---------- */
.online-lobby {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 22cqw);
  gap: 1.4cqw;
  padding-top: 1.6cqh;
}
.online-lobby[hidden] { display: none; }
.lobby-main, .lobby-side { min-height: 0; display: flex; }
.panel {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1.2cqw 1.3cqw;
  border: 1px solid rgba(236, 228, 210, .17);
  background:
    linear-gradient(180deg, rgba(236, 228, 210, .045), rgba(236, 228, 210, .012) 30%, rgba(5, 6, 7, .4));
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 2.2em; height: 2px;
  background: var(--red);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1em;
  padding-bottom: .75em;
  border-bottom: 1px solid rgba(236, 228, 210, .12);
}
.panel-head h3 {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(17px, 1.4cqw, 24px);
  letter-spacing: .12em;
  font-weight: 700;
}
.panel-head h3 span { color: var(--red); font-family: var(--f-cond); font-size: .7em; margin-left: .4em; }
.panel-head .eyebrow { margin-bottom: .2em; }
.panel-actions { display: flex; align-items: center; gap: .8em; }
.room-list { flex: 1; overflow-y: auto; margin-top: .8em; display: flex; flex-direction: column; gap: .45em; padding-right: .25em; scrollbar-width: thin; scrollbar-color: rgba(236, 228, 210, .25) transparent; }
.room-list-note { margin: .7em 0 0; font-size: clamp(8px, .62cqw, 10px); letter-spacing: .06em; color: rgba(236, 228, 210, .35); }
.room-search { display: flex; align-items: center; gap: 1em; margin-top: .8em; }
.room-search input { flex: 1; background: rgba(5, 6, 7, .45); color: var(--paper); border-color: rgba(236, 228, 210, .22); }
.room-search input::placeholder { color: rgba(236, 228, 210, .32); }
.room-search span { font-family: var(--f-cond); font-size: clamp(8px, .65cqw, 11px); letter-spacing: .12em; color: var(--paper-dim); opacity: .5; white-space: nowrap; }
.room-row {
  display: grid;
  grid-template-columns: 4.2em minmax(0, 1fr) minmax(7em, 1fr) 5.2em auto;
  align-items: center;
  gap: .8em;
  width: 100%;
  padding: .7em .8em;
  text-align: left;
  border: 1px solid rgba(236, 228, 210, .13);
  background: rgba(8, 9, 10, .35);
  color: var(--paper);
  transition: border-color .2s, background .2s, transform .2s;
}
.room-row:hover { border-color: rgba(197, 59, 44, .65); background: rgba(197, 59, 44, .1); transform: translateX(3px); }
.room-row-actions { display: flex; gap: .45em; justify-self: end; }
.row-btn {
  padding: .35em .7em;
  font-family: var(--f-display);
  font-size: clamp(11px, .86cqw, 14px);
  letter-spacing: .08em;
  border: 1px solid rgba(236, 228, 210, .3);
  color: var(--paper);
  transition: all .18s;
  white-space: nowrap;
}
.row-btn--join { border-color: rgba(197, 59, 44, .8); color: #f0c7bf; }
.row-btn--join:hover:not(:disabled) { background: rgba(197, 59, 44, .25); }
.row-btn--watch { border-color: rgba(111, 179, 184, .7); color: #bfe6ea; }
.row-btn--watch:hover:not(:disabled) { background: rgba(111, 179, 184, .18); }
.row-btn:disabled { opacity: .3; cursor: not-allowed; }
.room-row-id { font-family: var(--f-cond); font-size: clamp(10px, .78cqw, 13px); letter-spacing: .08em; color: var(--red); }
.room-row-name { min-width: 0; display: flex; flex-direction: column; gap: .12em; }
.room-row-name b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--f-display); font-size: clamp(13px, 1.05cqw, 17px); letter-spacing: .06em; }
.room-row-name small { font-size: clamp(8px, .6cqw, 10px); color: var(--paper-dim); opacity: .55; letter-spacing: .05em; }
.room-row-host { display: flex; align-items: center; gap: .45em; min-width: 0; font-size: clamp(9px, .72cqw, 12px); color: var(--paper-dim); }
.room-row-host span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-row-stage { font-size: clamp(8px, .62cqw, 10px); letter-spacing: .06em; color: rgba(236, 228, 210, .55); }
.room-row-join { justify-self: end; font-family: var(--f-display); font-size: clamp(12px, .95cqw, 15px); color: var(--amber); letter-spacing: .08em; }
.room-row .locked { color: var(--amber); font-family: var(--f-display); font-size: .9em; }
.room-empty { padding: 2.5em 1em; text-align: center; font-family: var(--f-display); color: rgba(236, 228, 210, .4); letter-spacing: .18em; font-size: clamp(13px, 1.1cqw, 18px); }
.room-empty small { display: block; margin-top: .6em; font-family: var(--f-sans); font-size: .55em; letter-spacing: .1em; color: rgba(236, 228, 210, .28); }

.add-friend { display: flex; gap: .5em; margin-top: .8em; }
.add-friend input { flex: 1; min-width: 0; background: rgba(5, 6, 7, .45); color: var(--paper); border-color: rgba(236, 228, 210, .22); }
.add-friend .text-btn { white-space: nowrap; }
.friend-requests, .friend-list { overflow-y: auto; scrollbar-width: thin; }
.friend-requests:empty { display: none; }
.friend-requests { margin-top: .7em; display: flex; flex-direction: column; gap: .4em; }
.friend-request {
  padding: .55em .65em;
  border-left: 2px solid var(--red);
  background: rgba(197, 59, 44, .08);
  font-size: clamp(9px, .68cqw, 11px);
}
.friend-request b { font-family: var(--f-display); font-size: 1.3em; letter-spacing: .06em; }
.friend-request .request-actions { display: flex; gap: .6em; margin-top: .35em; }
.friend-request .text-btn { font-size: .95em; padding: .1em 0; }
.friend-list { flex: 1; display: flex; flex-direction: column; gap: .35em; margin-top: .8em; }
.friend-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .55em; padding: .45em .4em; border-bottom: 1px solid rgba(236, 228, 210, .09); }
.friend-copy { min-width: 0; }
.friend-copy b { display: block; font-family: var(--f-display); font-size: clamp(12px, .92cqw, 15px); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-copy small { display: block; font-size: clamp(8px, .6cqw, 10px); color: var(--paper-dim); opacity: .55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-actions { display: flex; align-items: center; gap: .5em; }
.friend-actions .text-btn { padding: .1em 0; font-size: clamp(9px, .68cqw, 11px); }
.online-dot { width: .55em; height: .55em; border-radius: 50%; background: rgba(236, 228, 210, .25); flex: 0 0 auto; }
.online-dot.is-on { background: #7fc9a5; box-shadow: 0 0 8px rgba(127, 201, 165, .7); }
.friend-note { margin: .7em 0 0; font-size: clamp(8px, .6cqw, 10px); line-height: 1.7; color: rgba(236, 228, 210, .32); letter-spacing: .04em; }
.online-toast {
  position: absolute;
  left: 50%;
  bottom: 3cqh;
  translate: -50% 0;
  z-index: 30;
  max-width: 70cqw;
  padding: .6em 1.1em;
  background: rgba(8, 9, 10, .94);
  border: 1px solid rgba(236, 228, 210, .25);
  color: var(--paper);
  font-size: clamp(10px, .78cqw, 13px);
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.online-toast.is-on { opacity: 1; transform: translateY(-4px); }
.online-toast.is-error { border-color: rgba(197, 59, 44, .7); color: #f0b3a8; }

/* ---------- room ---------- */
.room-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5em;
  padding-bottom: 1.3cqh;
  border-bottom: 1px solid rgba(236, 228, 210, .16);
}
.room-heading { text-align: center; flex: 1; }
.room-heading h2 {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(24px, 2.6cqw, 44px);
  letter-spacing: .16em;
  line-height: 1.1;
}
.room-id-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  margin-top: .35em;
  font-family: var(--f-cond);
  font-size: clamp(9px, .7cqw, 12px);
  letter-spacing: .14em;
  color: var(--paper-dim);
}
.room-id-row b { color: var(--red); font-size: 1.35em; letter-spacing: .12em; }
.room-id-row .text-btn { padding: 0; font-size: .9em; border: 0; }
.room-status {
  align-self: center;
  padding: .45em .9em;
  border: 1px solid rgba(236, 228, 210, .22);
  font-family: var(--f-cond);
  font-size: clamp(9px, .72cqw, 12px);
  letter-spacing: .2em;
  color: var(--paper-dim);
  white-space: nowrap;
}
.room-grid {
  flex: 0 0 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 12cqw) minmax(0, 1fr);
  gap: 1.4cqw;
  padding: 2cqh 0 1.2cqh;
  align-items: start;
}
.room-player {
  align-self: start;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .7em;
  padding: 1.2cqw;
  border: 1px solid rgba(111, 179, 184, .35);
  background: linear-gradient(180deg, rgba(111, 179, 184, .08), rgba(6, 7, 8, .45));
}
.room-player--guest { border-color: rgba(227, 132, 58, .35); background: linear-gradient(180deg, rgba(227, 132, 58, .07), rgba(6, 7, 8, .45)); }
.room-player.is-empty { align-items: center; justify-content: center; border-style: dashed; color: rgba(236, 228, 210, .4); font-family: var(--f-display); letter-spacing: .15em; }
.room-player-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6em; height: 100%; }
.room-player-empty b { font-family: var(--f-cond); font-size: clamp(10px, .8cqw, 13px); letter-spacing: .24em; color: var(--red); }
.room-player-empty span { font-size: clamp(11px, .88cqw, 14px); letter-spacing: .12em; }
.room-player-slot { font-family: var(--f-cond); font-size: .58em; letter-spacing: .08em; color: var(--paper-dim); opacity: .55; }
.room-player-head { display: flex; align-items: center; gap: .8em; }
.room-player-copy { min-width: 0; flex: 1; }
.room-player-copy b { display: block; font-family: var(--f-display); font-size: clamp(18px, 1.6cqw, 26px); letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-player-copy small { display: block; margin-top: .18em; font-size: clamp(8px, .64cqw, 11px); color: var(--paper-dim); opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-player-stats { display: flex; gap: 1.2em; padding: .7em 0; border-top: 1px solid rgba(236, 228, 210, .12); border-bottom: 1px solid rgba(236, 228, 210, .1); }
.room-player-stats div { display: flex; flex-direction: column-reverse; gap: .12em; }
.room-player-stats dt { font-size: clamp(7px, .55cqw, 9px); letter-spacing: .1em; color: var(--paper-dim); opacity: .55; }
.room-player-stats dd { margin: 0; font-family: var(--f-cond); font-size: clamp(15px, 1.3cqw, 21px); line-height: 1; }
.room-player-stats .accent { color: var(--red); }
.room-char-title { font-family: var(--f-cond); font-size: clamp(8px, .62cqw, 10px); letter-spacing: .18em; color: var(--paper-dim); opacity: .55; }
.room-char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4em; }
.room-char-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4em;
  padding: .5em .6em;
  border: 1px solid rgba(236, 228, 210, .16);
  color: var(--paper-dim);
  font-family: var(--f-display);
  font-size: clamp(11px, .9cqw, 14px);
  letter-spacing: .08em;
  text-align: left;
  transition: all .18s;
}
.room-char-btn small { font-family: var(--f-cond); font-size: .65em; opacity: .5; letter-spacing: .04em; }
.room-char-btn:hover { border-color: rgba(236, 228, 210, .45); color: var(--paper); }
.room-char-btn.is-active { border-color: var(--accent, var(--red)); color: var(--paper); background: rgba(197, 59, 44, .12); }
.room-char-btn.is-mine { box-shadow: inset 0 0 0 1px rgba(236, 228, 210, .08); }
.room-ready-tag {
  align-self: flex-start;
  padding: .3em .7em;
  border: 1px solid rgba(236, 228, 210, .25);
  font-family: var(--f-cond);
  font-size: clamp(8px, .62cqw, 10px);
  letter-spacing: .16em;
  color: var(--paper-dim);
}
.room-ready-tag.is-ready { color: #9be0c0; border-color: rgba(127, 201, 165, .55); background: rgba(127, 201, 165, .08); }
.room-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9em;
  text-align: center;
  min-width: 0;
}
.room-vs {
  font-family: var(--f-display);
  font-size: clamp(34px, 4.2cqw, 70px);
  color: var(--red);
  transform: rotate(-6deg);
  text-shadow: 0 0 35px rgba(197, 59, 44, .35);
}
.room-stage { border-top: 1px solid rgba(236, 228, 210, .15); border-bottom: 1px solid rgba(236, 228, 210, .1); padding: .6em 0; width: 100%; }
.room-stage #roomStageView { font-family: var(--f-display); font-size: clamp(12px, .95cqw, 15px); letter-spacing: .08em; }
.room-net { font-family: var(--f-cond); font-size: clamp(8px, .65cqw, 11px); letter-spacing: .1em; color: rgba(236, 228, 210, .45); }
.room-center-note { margin: 0; font-size: clamp(8px, .62cqw, 10px); line-height: 1.7; color: rgba(236, 228, 210, .4); letter-spacing: .04em; max-width: 13em; }
.room-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.4cqw;
  padding: 1.3cqh .2cqw 0 0;
  border-top: 1px solid rgba(236, 228, 210, .15);
}
.host-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .55em; flex: 1; }
.host-tools label { display: flex; align-items: center; gap: .4em; font-size: clamp(8px, .65cqw, 11px); color: var(--paper-dim); letter-spacing: .06em; }
.host-tools input, .host-tools select {
  width: auto;
  min-width: 7em;
  background: rgba(5, 6, 7, .5);
  color: var(--paper);
  border-color: rgba(236, 228, 210, .2);
  font-size: clamp(9px, .7cqw, 12px);
  min-height: 2em;
  padding: .25em .45em;
}
.host-tools #roomEditName { min-width: 10em; }
.host-tools #roomLockPass { min-width: 7em; }
.host-tools #roomLockPass[hidden] { display: none; }
.lock-check { cursor: pointer; }
.lock-check input { width: auto; min-height: 0; accent-color: var(--red); }
.room-actions { display: flex; align-items: center; gap: .9em; flex: 0 0 auto; padding-right: .3cqw; }
.room-actions .brush-btn { min-width: 8.5em; }
.brush-btn--ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(236, 228, 210, .35);
  clip-path: none;
}
.brush-btn--ghost::before { border-color: rgba(236, 228, 210, .12); }
.brush-btn--ghost:hover { background: rgba(236, 228, 210, .08); color: var(--paper); }
.brush-btn--ghost:disabled { opacity: .28; }
.locked-note { color: var(--amber); }

/* ---------- dialogs / profile ---------- */
.profile-sheet, .online-dialog {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(120% 120% at 90% 0%, rgba(255, 252, 242, .92), transparent 55%),
    var(--paper);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .65);
  clip-path: polygon(0 1.5%, 98.8% 0, 100% 96%, 1.2% 100%);
}
.profile-sheet { width: min(62cqw, 900px); max-height: 82cqh; overflow: auto; padding: 2.2cqw; }
.profile-close { position: absolute; top: 1.2em; right: 1.4em; z-index: 2; color: #5c5a53; border-color: rgba(53, 59, 62, .3); }
.profile-hero { display: flex; gap: 1.6em; align-items: center; padding-bottom: 1.3em; border-bottom: 1px solid rgba(53, 59, 62, .22); }
.profile-hero h2 { margin: 0; font-family: var(--f-display); font-size: clamp(26px, 2.6cqw, 44px); letter-spacing: .1em; }
.profile-hero p { margin: .3em 0 0; font-size: clamp(10px, .75cqw, 12px); color: #6b675d; letter-spacing: .08em; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1em; padding: 1.2em 0; border-bottom: 1px solid rgba(53, 59, 62, .18); }
.profile-stats div { display: flex; flex-direction: column-reverse; gap: .2em; }
.profile-stats dt { font-size: clamp(8px, .62cqw, 10px); color: #6b675d; letter-spacing: .12em; }
.profile-stats dd { margin: 0; font-family: var(--f-cond); font-size: clamp(22px, 2cqw, 34px); line-height: 1; }
.profile-favorite { margin: 1.2em 0; display: flex; align-items: center; gap: 1em; font-family: var(--f-display); font-size: clamp(13px, 1.05cqw, 17px); }
.profile-favorite b { color: var(--red); font-size: 1.3em; letter-spacing: .08em; }
.profile-actions { display: flex; gap: 1.2em; flex-wrap: wrap; margin-top: 1.2em; }
.profile-actions .text-btn { color: #5c5a53; border-color: rgba(53, 59, 62, .25); }
.profile-recent { margin-top: 1.2em; font-size: clamp(9px, .68cqw, 11px); color: #6b675d; line-height: 1.9; }
.online-dialog { width: min(28cqw, 420px); padding: 2.2em 2em 1.8em; }
.online-dialog h2 { margin: .1em 0 .5em; font-family: var(--f-display); font-size: clamp(26px, 2.2cqw, 38px); letter-spacing: .12em; }
.online-dialog .eyebrow { color: #726d61; }
.dialog-copy { margin: 0 0 1.1em; font-size: clamp(10px, .8cqw, 13px); line-height: 1.8; color: #5c5a53; }
.online-form { display: flex; flex-direction: column; gap: .8em; }
.online-form .dialog-actions, .dialog-actions { display: flex; align-items: center; gap: 1em; flex-wrap: wrap; margin-top: .6em; }
.online-form .brush-btn { background: var(--ink); color: var(--paper); }
.online-form .brush-btn i { color: var(--amber); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.online-dialog select { background: rgba(255, 255, 255, .35); }
.screen--profile, .screen--create, .screen--join, .screen--leave { z-index: 45; }

/* ---------- invites ---------- */
.invite-stack { position: fixed; right: 1.4cqw; bottom: 1.8cqh; z-index: 900; display: flex; flex-direction: column; gap: .6em; width: min(25cqw, 330px); pointer-events: none; }
.invite-card {
  pointer-events: auto;
  padding: .8em .9em;
  border: 1px solid rgba(197, 59, 44, .7);
  background: rgba(8, 9, 10, .95);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  color: var(--paper);
  clip-path: polygon(0 0, 100% 3%, 98.5% 100%, 1% 97%);
}
.invite-card p { margin: 0 0 .2em; font-size: clamp(9px, .7cqw, 12px); color: var(--paper-dim); }
.invite-card b { display: block; font-family: var(--f-display); font-size: clamp(14px, 1.1cqw, 18px); letter-spacing: .08em; }
.invite-card small { display: block; margin: .25em 0 .5em; color: rgba(236, 228, 210, .5); font-size: clamp(8px, .6cqw, 10px); letter-spacing: .06em; }
.invite-card .invite-actions { display: flex; gap: .7em; }
.invite-card .text-btn { font-size: clamp(9px, .7cqw, 11px); }
.net-badge { font-family: var(--f-cond); font-size: clamp(8px, .62cqw, 10px); letter-spacing: .12em; color: rgba(236, 228, 210, .55); white-space: nowrap; }
.net-badge[hidden] { display: none; }

.room-player.is-self { box-shadow: inset 0 0 0 1px rgba(236, 228, 210, .12); }

/* ---------- spectator seats ---------- */
.room-spectators {
  flex: 0 0 auto;
  margin-top: auto;
  padding: .7em 0 .9em;
  border-top: 1px solid rgba(236, 228, 210, .12);
}
.room-spectators[hidden] { display: none !important; }
.spectator-head {
  display: flex;
  align-items: baseline;
  gap: .9em;
  margin-bottom: .55em;
}
.spectator-head .eyebrow { margin: 0; }
.spectator-head b {
  font-family: var(--f-display);
  font-size: clamp(13px, 1.05cqw, 17px);
  letter-spacing: .1em;
  color: var(--paper);
}
.spectator-head b span { color: var(--teal); font-family: var(--f-cond); }
.spectator-head b i { font-style: normal; font-family: var(--f-cond); font-size: .8em; opacity: .5; }
.spectator-note { font-size: clamp(8px, .62cqw, 10px); letter-spacing: .06em; color: rgba(236, 228, 210, .38); }
.spectator-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: .3em;
}
.spectator-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15em;
  min-width: 0;
  padding: .25em 0;
  border: 1px dashed rgba(236, 228, 210, .12);
  background: rgba(8, 9, 10, .3);
  color: inherit;
  font: inherit;
}
.spectator-seat.is-empty { cursor: pointer; }
.spectator-seat.is-empty:hover {
  border-color: rgba(197, 59, 44, .7);
  background: rgba(197, 59, 44, .12);
}
.spectator-seat.is-empty:hover i { color: var(--red); }
.seat-claim { margin-top: .6em; }
.spectator-seat i {
  font-style: normal;
  font-size: clamp(7px, .52cqw, 9px);
  color: rgba(236, 228, 210, .3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.spectator-seat .avatar { width: 1.7em; height: 1.7em; font-size: clamp(8px, .62cqw, 10px); }
.spectator-seat.is-taken { border-style: solid; border-color: rgba(111, 179, 184, .45); background: rgba(111, 179, 184, .08); }
.spectator-seat.is-taken i { color: rgba(236, 228, 210, .7); }
.spectator-seat.is-me { border-color: var(--amber); background: rgba(227, 132, 58, .14); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .screen--online, .screen--room { padding: 2.2cqh 2.8cqw; }
  .online-lobby { grid-template-columns: minmax(0, 1fr) minmax(210px, 26cqw); }
  .auth-wrap { grid-template-columns: 1fr; gap: 1.2em; padding: 2cqh 1cqw; }
  .auth-aside { display: none; }
  .auth-card { justify-self: center; width: min(90%, 460px); }
  .room-grid { grid-template-columns: minmax(0, 1fr) 10cqw minmax(0, 1fr); gap: 1cqw; }
  .room-player { padding: .8cqw; }
  .room-char-btn small { display: none; }
  .host-tools { gap: .35em; }
  .room-actions .brush-btn { min-width: 6.5em; }
}
@media (max-width: 760px) {
  .online-top { grid-template-columns: 1fr auto; }
  .online-brand { text-align: right; }
  .online-user { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-start; }
  .online-conn { display: none; }
  .online-lobby { grid-template-columns: 1fr; }
  .lobby-side { min-height: 20cqh; }
  .room-grid { grid-template-columns: 1fr; }
  .room-center { flex-direction: row; justify-content: space-around; padding: .4em 0; }
  .room-vs { font-size: 2.2cqw; }
  .room-center-note { display: none; }
  .room-player { max-height: 27cqh; overflow: auto; }
  .room-footer { flex-direction: column; align-items: stretch; }
  .room-actions { justify-content: flex-end; }
  .auth-card { width: 100%; }
  .profile-sheet { width: 92cqw; }
  .online-dialog { width: 88cqw; }
  .invite-stack { right: 3cqw; width: 70cqw; }
}
