@font-face { font-family: Outfit; src: url('../fonts/outfit-latin.woff2') format('woff2'); font-weight: 100 900; }
:root {
  --bg: #0d0d0f;
  --surface: rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.08);
  --panel: rgba(20,22,31,.9);
  --panel2: rgba(32,35,48,.88);
  --line: rgba(255,255,255,0.1);
  --text: #e8e8f0;
  --muted: rgba(255,255,255,0.45);
  --accent: #7c6af7;
  --accent-glow: rgba(124,106,247,0.35);
  --aqua: #27d3c3;
  --danger: #ff5f7a;
  --border: var(--line);
  --radius: 12px;
  --radius-sm: 8px;
  --surface-hover: rgba(255,255,255,.1);
  --text-muted: var(--muted);
  --sidebar-width: 330px;
  --msg-text-indent: 55px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: Outfit, system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
button, input, select { font: inherit; }
.auth-shell, .picker-shell { min-height: 100%; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 10%, rgba(39,211,195,.16), transparent 28%), radial-gradient(circle at 85% 0%, rgba(124,106,247,.2), transparent 30%), #0c0d12; }
.auth-card, .picker-main { width: min(1040px, 100%); background: rgba(15,17,24,.88); border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.auth-card { max-width: 430px; }
.auth-logo-link {
  display: block;
  margin: 0 auto 24px;
  text-decoration: none;
}
.auth-logo-full {
  display: block;
  width: min(320px, 100%);
  max-height: 150px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}
.auth-logo-full.custom-brand-logo {
  max-height: 170px;
}
.auth-action-panel {
  display: grid;
  gap: 9px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,106,247,.10), rgba(255,255,255,.035));
}
.auth-action-panel span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.auth-main-link {
  width: 100%;
  min-height: 42px;
  font-weight: 900;
}
.auth-utility-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.auth-utility-actions.single {
  grid-template-columns: 1fr;
}
.auth-utility-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}
.auth-utility-btn:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(124,106,247,.42);
}
.auth-about-btn {
  background: linear-gradient(135deg, rgba(124,106,247,.14), rgba(39,211,195,.07));
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand h1 { font-size: 24px; margin: 0; letter-spacing: 0; }
.brand span { color: var(--muted); font-size: 13px; }
.app-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-title img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}
.app-title img.custom-brand-logo {
  width: 96px;
  height: 96px;
}
.app-name {
  font-size: 34px;
  font-weight: 900;
  line-height: .95;
  overflow-wrap: anywhere;
}
.app-edition {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 800;
}
.picker-title {
  display: inline-flex;
  align-items: center;
  margin: 18px 0 0;
  padding: 7px 14px 8px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,106,247,.18), rgba(255,255,255,.045));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}
.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 800;
}
.check-label input {
  width: auto;
  flex: 0 0 auto;
}
input, select { width: 100%; color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 7px; padding: 11px 12px; outline: none; }
select option {
  background: #171923;
  color: var(--text);
}
select option:checked {
  background: rgba(124,106,247,.55);
  color: #fff;
}
textarea { font: inherit; }
input:focus,
select:focus,
textarea:focus { border-color: rgba(124,106,247,.8); box-shadow: 0 0 0 3px rgba(124,106,247,.15); }
.setup-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 34px;
  background:
    radial-gradient(circle at 10% 10%, rgba(39,211,195,.14), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(124,106,247,.22), transparent 30%),
    #07080c;
}
.setup-card {
  width: min(760px, 100%);
  padding: 28px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(20,22,31,.96), rgba(8,9,14,.94)),
    rgba(15,17,24,.92);
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
}
.setup-brand { margin-bottom: 20px; }
.setup-brand-full img {
  width: min(360px, 100%);
  height: auto;
}
.setup-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
}
.setup-step {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
}
.setup-step.active {
  color: #fff;
  border-color: rgba(124,106,247,.55);
  background: rgba(124,106,247,.19);
}
.setup-step.done { color: rgba(255,255,255,.75); }
.setup-step-sep { opacity: .4; }
.setup-card h1 {
  margin: 0 0 6px;
  font-size: 25px;
  line-height: 1.08;
}
.subtitle {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 14px;
}
.setup-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}
.setup-alert-error {
  border: 1px solid rgba(255,95,122,.35);
  color: #ffd7df;
  background: rgba(255,95,122,.1);
}
.setup-alert-ok {
  border: 1px solid rgba(39,211,195,.35);
  color: #b8fff6;
  background: rgba(39,211,195,.1);
}
.setup-preflight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.setup-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(0,0,0,.2);
  font-size: 12px;
}
.setup-check span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.setup-check.ok span { color: #7ff3df; }
.setup-check.warn span { color: #f5c842; }
.setup-check.bad span { color: #ff9aac; }
.setup-check strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.setup-check em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 11px;
}
.setup-form {
  display: grid;
  gap: 13px;
}
.setup-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.setup-choice input { display: none; }
.setup-choice-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .14s;
}
.setup-choice-card.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(124,106,247,.17), rgba(255,255,255,.035));
}
.setup-choice-card:hover { transform: translateY(-1px); }
.setup-choice-card strong {
  color: #fff;
  font-size: 17px;
}
.setup-choice-card span {
  color: var(--text-muted);
  line-height: 1.45;
}
.setup-choice-card em {
  color: #a89ff7;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.setup-branding-fields {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.setup-branding-fields h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}
.setup-branding-fields .minor {
  margin: -4px 0 0;
}
.mysql-fields {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background: rgba(0,0,0,.2);
}
.mysql-fields[hidden] { display: none; }
.setup-submit {
  width: 100%;
  justify-content: center;
  padding: 13px 16px;
}
.setup-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
}
@media (max-width: 720px) {
  .setup-preflight,
  .setup-choice-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
}
.file-picker {
  position: relative;
  min-height: 41px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px;
  overflow: hidden;
  cursor: pointer;
}
.file-picker:focus-within {
  border-color: rgba(124,106,247,.8);
  box-shadow: 0 0 0 3px rgba(124,106,247,.15);
}
.file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  padding: 0;
}
.file-picker-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: 8px 11px;
  font-weight: 700;
  font-size: 13px;
}
.file-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 13px;
}
.file-picker:hover .file-picker-btn { background: var(--surface-hover); }
.upload-progress {
  display: none;
  margin: 8px 0 2px;
}
.upload-progress.open {
  display: block;
}
.upload-progress-track {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}
.upload-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), #5a86ff);
  transition: width .1s linear;
}
.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}
.btn { border: 1px solid var(--line); border-radius: 7px; padding: 10px 14px; color: var(--text); background: rgba(255,255,255,.07); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: rgba(255,255,255,.11); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #5a86ff); border-color: transparent; }
.btn-aqua { background: linear-gradient(135deg, var(--aqua), #4f9cff); border-color: transparent; color: #071013; font-weight: 700; }
.btn-danger { background: rgba(255,95,122,.16); border-color: rgba(255,95,122,.35); color: #ffd7df; }
.btn-voice { background: linear-gradient(135deg, var(--accent), #5a86ff); border-color: transparent; color: #fff; font-weight: 800; }
.btn-voice:hover { background: linear-gradient(135deg, #8a78ff, #6592ff); }
.btn-voice.active {
  border-color: rgba(255,95,122,.38);
  background: rgba(255,95,122,.16);
  color: #ffd7df;
}
.btn-voice.active:hover {
  background: rgba(255,95,122,.24);
  border-color: rgba(255,95,122,.48);
}
.minor { color: var(--muted); font-size: 13px; }
.error { color: #ffd7df; background: rgba(255,95,122,.12); border: 1px solid rgba(255,95,122,.32); padding: 10px 12px; border-radius: 7px; margin-bottom: 12px; }
.success { color: #dfffee; background: rgba(104,245,155,.12); border: 1px solid rgba(104,245,155,.28); padding: 10px 12px; border-radius: 7px; margin-bottom: 12px; }
.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
  padding: 24px 268px 0 0;
}
.topbar h1 { margin: 0; font-size: 25px; }
.topbar .picker-title { margin: 18px 0 0; font-size: 18px; }
.lobby-brand-block { min-width: 0; }
.top-actions {
  position: absolute;
  top: 30px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 230px;
  min-height: 42px;
  margin-left: 0;
  padding: 4px 6px 4px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.lobby-signed-in {
  white-space: nowrap;
  font-size: 12px;
  line-height: 1;
}
.lobby-signed-in strong { color: var(--text); font-weight: 800; margin-left: 2px; }
.lobby-gear {
  position: static;
  flex: 0 0 34px;
  transform: translateY(2px);
}
#lobby-menu {
  position: absolute;
  top: 78px;
  right: 24px;
  display: none;
  z-index: 10000;
  min-width: 168px;
  padding: 6px;
  background: rgba(20,20,30,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#lobby-menu.visible { display: block; }
.powered-by {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.powered-by img {
  display: block;
  width: min(190px, 70%);
  max-height: 64px;
  object-fit: contain;
  opacity: .86;
}
.auth-powered-by {
  margin-top: 20px;
}
.lobby-powered-by {
  margin-top: 26px;
}
#lobby-menu button,
#lobby-menu a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
#lobby-menu .menu-form {
  margin: 0;
}
#lobby-menu .menu-form button {
  font: inherit;
}
#lobby-menu img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 18px;
}
#lobby-menu button:hover,
#lobby-menu a:hover { background: var(--surface-hover); }
.room-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: stretch; }
.room-card { min-height: 210px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--panel2); position: relative; display: flex; flex-direction: column; justify-content: flex-end; }
.room-card-entering {
  opacity: 0;
  transform: translateX(-18px) scale(.985);
}
.room-card-entering.show {
  opacity: 1;
  transform: translateX(0) scale(1);
  transition: opacity .32s ease, transform .32s cubic-bezier(.2,.78,.28,1);
}
.room-card-leaving {
  opacity: 0;
  transform: translateX(18px) scale(.985);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.create-room-tile {
  justify-content: stretch;
  padding: 16px;
  background:
    radial-gradient(240px 180px at 18% 0%, rgba(39,211,195,.16), transparent 70%),
    linear-gradient(135deg, rgba(24,27,38,.96), rgba(13,15,21,.98));
}
.create-room-tile-inner {
  display: grid;
  gap: 12px;
  align-content: start;
  width: 100%;
}
.create-room-tile h2 {
  margin: 0 0 2px;
}
.create-room-tile input[name="name"],
.create-room-tile input[name="name"]:hover,
.create-room-tile input[name="name"]:focus,
.create-room-tile input[name="name"]:active,
.create-room-tile input[name="name"]:valid,
.create-room-tile input[name="name"]:invalid,
.create-room-tile input[name="name"]:disabled {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  background: #22252e !important;
  border-color: rgba(255,255,255,.14);
  appearance: none;
}
.create-room-tile input[name="name"]:focus {
  border-color: rgba(124,106,247,.75);
  box-shadow: 0 0 0 2px rgba(124,106,247,.22);
}
.create-room-tile input[name="name"]:-webkit-autofill,
.create-room-tile input[name="name"]:-webkit-autofill:hover,
.create-room-tile input[name="name"]:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  box-shadow: 0 0 0 1000px #22252e inset !important;
  transition: background-color 9999s ease-out 0s;
}
.form-error {
  padding: 9px 10px;
  border: 1px solid rgba(255,95,122,.38);
  border-radius: var(--radius-sm);
  color: #ffd7df;
  background: rgba(255,95,122,.12);
  font-size: 12px;
  font-weight: 800;
}
.create-room-tile .btn-aqua,
.create-room-tile .btn-primary { width: 100%; }
.room-card-media { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(124,106,247,.38), rgba(39,211,195,.22)); background-size: cover; background-position: center; }
.room-card video { width: 100%; height: 100%; object-fit: cover; }
.room-video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.72);
  font-weight: 900;
  letter-spacing: .02em;
  background:
    radial-gradient(circle at 24% 18%, rgba(124,106,247,.35), transparent 34%),
    linear-gradient(135deg, rgba(12,14,22,.96), rgba(24,31,44,.98));
}
.room-card-body {
  position: relative;
  padding: 15px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.62) 32%, rgba(0,0,0,.9)),
    linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.28) 72%, rgba(0,0,0,.08));
  text-shadow: 0 2px 8px rgba(0,0,0,.85);
}
.room-card h2 { margin: 0 0 6px; font-size: 18px; }
.room-layout {
  display: flex;
  height: 100%;
  align-items: stretch;
}
.version-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 18px;
  background: rgba(22, 18, 36, .97);
  border-bottom: 1px solid rgba(124,106,247,.55);
  box-shadow: 0 10px 28px rgba(0,0,0,.38);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.version-banner[hidden] { display: none; }
.version-banner .btn {
  width: auto;
  min-height: 30px;
  padding: 6px 14px;
}
.main { flex: 1 1 auto; position: relative; padding: 10px; min-width: 0; }
.room-stage {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: calc(var(--room-height, 60%) - 10px);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.room-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #172033, #16302d) center/cover; filter: brightness(.45); }
.room-bg video { width: 100%; height: 100%; object-fit: cover; }
.room-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.1), rgba(0,0,0,.2)); }
.room-bg-next { opacity: 0; transition: opacity .5s ease; z-index: 1; }
.room-bg-next.show { opacity: 1; }
.game-stage-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 12px 14px 14px;
  background:
    radial-gradient(820px 440px at 50% 0%, rgba(124,106,247,.12), transparent 58%),
    linear-gradient(135deg, #030407, #080912 52%, #020306);
  border-radius: inherit;
}
.game-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 0 0 8px;
}
.game-stage-head strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 20px;
}
.game-stage-title img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.game-stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-stage-actions .btn {
  width: auto;
  min-height: 34px;
  padding: 7px 13px;
  font-size: 13px;
}
.game-stage-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(116px, 156px) minmax(620px, 1fr) minmax(116px, 156px);
  gap: 12px;
  align-items: stretch;
}
.game-frame-wrap {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background:
    radial-gradient(620px 320px at 50% 18%, rgba(124,106,247,.08), transparent 62%),
    linear-gradient(180deg, rgba(8,9,15,.98), rgba(1,2,5,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 18px 44px rgba(0,0,0,.36);
}
.game-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}
.game-player-card {
  min-width: 0;
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 14px 10px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)),
    rgba(0,0,0,.22);
  text-align: center;
}
.game-player-card img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 8px;
}
.game-player-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.game-player-card .minor {
  min-height: 17px;
  font-weight: 800;
  color: rgba(255,255,255,.7);
}
.game-player-role {
  color: rgba(255,255,255,.86);
}
.game-player-role.is-you::after {
  content: " (You)";
  color: rgba(255,255,255,.58);
}
.game-typing-pill {
  display: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(124,106,247,.24);
  color: rgba(255,255,255,.82);
  font-size: 11px;
  font-weight: 800;
}
.game-player-card.typing .game-typing-pill { display: inline-flex; }
.room-stage.effect-romantic-mood {
  box-shadow:
    inset 0 0 38px rgba(255, 94, 184, .45),
    inset 0 0 84px rgba(255, 128, 210, .2),
    0 0 18px rgba(255, 94, 184, .24);
}
.room-effect-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.romantic-mood-layer {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 116, 197, .16), transparent 36%),
    linear-gradient(135deg, rgba(255, 75, 169, .12), rgba(255, 176, 222, .04));
  mix-blend-mode: screen;
}
.romantic-heart {
  position: absolute;
  bottom: -36px;
  color: rgba(255, 138, 209, .88);
  font-size: var(--heart-size, 22px);
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 12px rgba(255, 64, 172, .85), 0 2px 8px rgba(0,0,0,.6);
  animation: romanticHeartFloat var(--heart-duration, 8s) linear infinite;
}
@keyframes romanticHeartFloat {
  0% { transform: translate3d(0, 0, 0) rotate(-8deg) scale(.75); opacity: 0; }
  12% { opacity: .78; }
  52% { transform: translate3d(var(--heart-drift, 24px), -48vh, 0) rotate(8deg) scale(1); }
  100% { transform: translate3d(calc(var(--heart-drift, 24px) * -1), -104vh, 0) rotate(-18deg) scale(.82); opacity: 0; }
}
.dm-flight {
  position: absolute;
  z-index: 8;
  width: 56px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.42));
  will-change: left, top, transform, opacity;
}
.divider {
  position: absolute;
  top: calc(var(--room-height, 60%) + 5px);
  left: 10px;
  right: 10px;
  height: 6px;
  cursor: row-resize;
  background: var(--border);
  border-radius: 3px;
  z-index: 10;
  transition: background .15s;
}
.divider:hover { background: var(--accent); }
.vertical-divider {
  flex: 0 0 6px;
  width: 6px;
  height: calc(100% - 20px);
  margin: 10px 0;
  border-radius: 3px;
  background: transparent;
  cursor: col-resize;
  z-index: 10;
  opacity: 0;
  transition: background .15s, opacity .15s;
}
.vertical-divider:hover,
.vertical-divider.dragging {
  background: var(--accent);
  opacity: 1;
}
.chat-pane {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: calc(100% - var(--room-height, 60%) - 26px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 280px at 18% 0%, rgba(124,106,247,.12), transparent 58%),
    radial-gradient(760px 260px at 88% 35%, rgba(39,211,195,.08), transparent 62%),
    linear-gradient(180deg, rgba(18,20,29,.95), rgba(9,10,15,.98));
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.11);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 50px rgba(0,0,0,.28);
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 10px;
  display: block;
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 24%),
    linear-gradient(135deg, rgba(255,255,255,.025), rgba(0,0,0,.08));
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.message {
  display: block;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  word-break: break-word;
  line-height: 1.5;
  gap: 12px;
  max-width: none;
  border: 1px solid rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 10px 24px rgba(0,0,0,.26);
}
.message.deleted {
  background: linear-gradient(135deg, rgba(92, 15, 28, .78), rgba(34, 14, 20, .92));
  border-color: rgba(255,95,122,.34);
}
.message.me {
  background:
    linear-gradient(135deg, rgba(12,15,21,.98), rgba(8,10,14,.96) 52%, rgba(3,4,7,.98));
  border-color: rgba(140,207,255,.11);
  flex-direction: row;
}
.message:not(.me) {
  background:
    linear-gradient(135deg, rgba(11,12,17,.98), rgba(7,8,12,.97) 56%, rgba(2,3,5,.99));
}
.message-wipe-out {
  pointer-events: none;
  overflow: hidden;
  animation: messageWipeOut .42s ease forwards;
  transform-origin: center bottom;
}
@keyframes messageWipeOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(.985);
    filter: blur(3px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
  }
}
.message img { width: 40px; height: 40px; border-radius: 0; object-fit: cover; flex-shrink: 0; position: relative; z-index: 2; }
.bubble { background: transparent; border: none; padding: 0; border-radius: 0; line-height: 1.5; flex: 1; min-width: 0; }
.message.me .bubble { background: transparent; }
.msg-head { display: flex; align-items: center; gap: 8px; }
.msg-name {
  width: 236px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 236px;
  margin-left: 0;
  padding: 4px 34px 4px 5px;
  border-radius: 5px 0 0 5px;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  border-left: 1px solid rgba(255,255,255,.18);
  position: relative;
  z-index: 1;
}
.msg-name-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}
.msg-name-text,
.msg-name-time {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-name-text { line-height: 15px; }
.msg-name-time {
  margin-top: 1px;
  color: rgba(255,255,255,.62);
  font-size: 10px;
  font-weight: 600;
  line-height: 12px;
  text-shadow: 0 1px 3px rgba(0,0,0,.72);
}
.msg-name.role-user {
  background: linear-gradient(90deg, rgba(16,18,24,.95), rgba(35,38,48,.62) 58%, rgba(35,38,48,0));
}
.msg-name.role-admin {
  background: linear-gradient(90deg, rgba(86,8,25,.86), rgba(31,11,18,.62) 58%, rgba(31,11,18,0));
}
.msg-name.role-developer {
  background: linear-gradient(90deg, rgba(20,45,116,.88), rgba(10,20,48,.64) 58%, rgba(10,20,48,0));
}
.msg-name.role-guide {
  background: linear-gradient(90deg, rgba(9,94,58,.82), rgba(8,35,25,.64) 58%, rgba(8,35,25,0));
}
.msg-name.role-owner {
  background: linear-gradient(90deg, rgba(154,105,20,.9), rgba(76,48,13,.68) 52%, rgba(24,18,10,0));
  border-left-color: rgba(244,190,82,.5);
}
.msg-options {
  margin-left: auto;
  width: 26px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 5px;
  background: rgba(255,255,255,.045);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  padding: 0 0 4px;
}
.msg-options:hover { color: var(--text); background: rgba(255,255,255,.08); }
.msg-content {
  margin-top: 7px;
  padding-left: var(--msg-text-indent);
}
.chat-text-link {
  color: #c8c2ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(200,194,255,.32);
}
.chat-text-link:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,.55);
}
.url-preview {
  margin-top: 10px;
  max-width: min(390px, 100%);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(18,20,29,.94), rgba(5,6,10,.96));
  box-shadow: inset 3px 0 0 rgba(124,106,247,.62), 0 10px 26px rgba(0,0,0,.22);
  overflow: hidden;
}
.url-preview-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  color: var(--text);
  text-decoration: none;
}
.url-preview-summary:has(.url-preview-thumb) {
  grid-template-columns: 92px minmax(0, 1fr);
}
.url-preview-thumb {
  display: block;
  min-height: 92px;
  background: rgba(0,0,0,.22);
}
.url-preview-thumb img {
  width: 92px;
  height: 100%;
  min-height: 92px;
  max-height: 128px;
  object-fit: cover;
  border-radius: 0;
}
.url-preview-copy {
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 10px 12px;
}
.url-preview-host {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.url-preview-title {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
}
.url-preview-description {
  display: -webkit-box;
  color: rgba(232,232,240,.68);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.url-preview-player {
  display: grid;
  gap: 8px;
  padding: 10px;
}
.url-preview-player iframe {
  width: 100%;
  height: 198px;
  border: 0;
  border-radius: 7px;
  background: #05060a;
}
.url-preview-player.spotify iframe {
  height: 152px;
}
.url-preview-player.soundcloud iframe {
  height: 166px;
}
.msg-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding-left: var(--msg-text-indent);
  min-height: 0;
}
.msg-audit {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
}
.deleted-audit { color: #ff9cad; }
.msg-deleted-body {
  color: #ffd4dc;
  text-decoration: line-through;
  opacity: .82;
}
.msg-original {
  margin-top: 6px;
  padding-left: var(--msg-text-indent);
  font-size: 12px;
  color: var(--text-muted);
}
.msg-original summary { cursor: pointer; color: #f0d38a; }
.msg-original div {
  margin-top: 5px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  background: rgba(0,0,0,.2);
  color: var(--text);
}
.msg-reply-preview {
  width: min(520px, calc(100% - var(--msg-text-indent)));
  margin: 2px 0 9px var(--msg-text-indent);
  padding: 7px 10px 8px 12px;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(124,106,247,.24);
  border-left: 3px solid rgba(124,106,247,.78);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(124,106,247,.16), rgba(0,0,0,.18) 58%, rgba(0,0,0,.05)),
    rgba(255,255,255,.035);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.msg-reply-preview span {
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 800;
}
.msg-reply-preview strong {
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-reply-preview:hover {
  border-color: rgba(124,106,247,.48);
  background:
    linear-gradient(90deg, rgba(124,106,247,.24), rgba(0,0,0,.2) 58%, rgba(0,0,0,.08)),
    rgba(255,255,255,.045);
}
.message-reply-flash {
  animation: replyFlash 1.15s ease;
}
@keyframes replyFlash {
  0%, 100% { box-shadow: inset 0 0 0 1px transparent; }
  20% { box-shadow: inset 0 0 0 1px rgba(124,106,247,.9), 0 0 24px rgba(124,106,247,.18); }
}
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  padding: 3px 6px 3px 7px;
  cursor: pointer;
  font-size: 13px;
  min-height: 26px;
}
.reaction-chip.own {
  border-color: rgba(124,106,247,.7);
  background: rgba(124,106,247,.18);
}
.reaction-emoji { line-height: 1; }
.reaction-avatars {
  display: inline-flex;
  align-items: center;
}
.reaction-avatars img {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.35);
  margin-left: -4px;
  background: #11131b;
}
.reaction-avatars img:first-child { margin-left: 0; }
.edit-msg-input {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid rgba(124,106,247,.65);
  border-radius: 8px;
  outline: none;
  background: rgba(0,0,0,.22);
  color: var(--text);
  line-height: 1.45;
}
.edit-msg-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.edit-msg-actions .btn {
  width: auto;
  min-height: 32px;
  padding: 7px 12px;
}
.chat-attachment-image {
  display: inline-block;
  max-width: min(360px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,.22);
}
.chat-attachment-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  border-radius: 0;
}
.message .chat-attachment-image img {
  width: 100%;
  height: auto;
  max-width: none;
}
.chat-attachment-image.chat-gif:not(.chat-gesture-gif) {
  width: min(256px, 100%);
  max-width: min(256px, 100%);
}
.chat-attachment-image.chat-gif:not(.chat-gesture-gif) img {
  width: 100%;
  height: auto;
  max-height: 202px;
  object-fit: contain;
}
.chat-gesture {
  display: inline-grid;
  gap: 7px;
  max-width: min(320px, 100%);
}
.chat-gesture .chat-attachment-image.chat-gif {
  display: inline-grid;
  place-items: center;
  width: max-content;
  max-width: min(320px, 100%);
}
.chat-gesture .chat-attachment-image.chat-gif img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 238px;
}
.chat-gesture-text {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.chat-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  text-decoration: none;
}
.chat-file-icon {
  width: 30px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(124,106,247,.28);
  font-size: 11px;
  font-weight: 900;
  color: var(--text);
}
.chat-file-name {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}
.chat-file-meta {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}
.voice-note-player audio {
  width: min(360px, 100%);
  max-width: 100%;
}
.chat-system {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
  color: var(--text-muted);
  font-size: 12px;
}
.system-badge {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  padding: 4px 10px;
}
.reply-draft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 8px -2px;
  padding: 8px 10px 8px 12px;
  border: 1px solid rgba(124,106,247,.34);
  border-left: 3px solid rgba(124,106,247,.9);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(124,106,247,.2), rgba(8,9,15,.92) 58%),
    rgba(255,255,255,.04);
}
.reply-draft[hidden] { display: none; }
.reply-draft div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.reply-draft strong {
  color: #fff;
  font-size: 12px;
}
.reply-draft span {
  color: rgba(255,255,255,.68);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-draft button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 8px;
  margin: 7px 8px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
  position: relative;
  top: -1px;
}
.hidden-file-input { display: none; }
.attach-menu {
  position: absolute;
  left: 8px;
  bottom: calc(100% + 6px);
  width: 188px;
  padding: 6px;
  background: #151620;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(0,0,0,.38);
  z-index: 25;
}
.attach-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.attach-menu button:hover { background: var(--surface-hover); }
.composer textarea {
  flex: 1;
  min-height: 38px;
  max-height: 132px;
  padding: 9px 4px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  resize: none;
  outline: none;
  overflow-y: auto;
}
.composer textarea:focus { box-shadow: none; }
.composer-icon-btn,
.send-btn {
  height: 38px;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s;
}
.composer-icon-btn {
  width: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
}
.composer-icon-btn img {
  width: 21px;
  height: 21px;
  display: block;
  object-fit: contain;
  filter: invert(1);
  mix-blend-mode: screen;
}
.composer-icon-btn:hover { background: transparent; color: var(--text); }
.composer-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 38px;
}
.char-counter {
  min-width: 58px;
  text-align: right;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.send-btn {
  width: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
}
.send-btn img {
  width: 25px;
  height: 25px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  filter: invert(1);
  mix-blend-mode: screen;
}
.composer .emoji-btn {
  padding: 0;
}
.composer .emoji-btn img { width: 24px; height: 24px; }
.composer .gif-btn img { width: 24px; height: 24px; }
.send-btn:hover { background: transparent; }
.chat-tabs {
  display: flex;
  gap: 7px;
  padding: 7px 8px 1px;
  border-top: 1px solid transparent;
  background: linear-gradient(180deg, rgba(0,0,0,.24), rgba(255,255,255,.025));
  overflow-x: auto;
  min-height: 44px;
  align-items: flex-start;
}
#link-tabs { display: contents; }
.chat-tab {
  min-width: 124px;
  height: 36px;
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.08);
  border-top-color: rgba(255,255,255,.12);
  border-radius: 0 0 7px 7px;
  background: rgba(255,255,255,.045);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 28px 0 15px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  margin: 0;
  transform: translateY(-1px);
}
.chat-tab img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex: 0 0 auto;
}
.link-tab-heart {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 15px;
  font-size: 13px;
  line-height: 1;
}
.tab-badge {
  position: absolute;
  top: 3px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #15151d;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.tab-badge[hidden] { display: none; }
.chat-tab:hover,
.chat-tab.active {
  background: rgba(255,255,255,.085);
  color: var(--text);
  border-color: rgba(124,106,247,.55);
}
.chat-tab.active {
  background: rgba(124,106,247,.18);
  color: #f4f1ff;
  box-shadow: inset 0 3px 0 rgba(124,106,247,.85);
}
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100% - 20px);
  margin: 10px 10px 10px 0;
  background:
    radial-gradient(360px 260px at 18% 4%, rgba(124,106,247,.12), transparent 62%),
    radial-gradient(320px 240px at 92% 44%, rgba(39,211,195,.07), transparent 66%),
    linear-gradient(180deg, rgba(18,19,26,.96), rgba(10,10,14,.99));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.105);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 16px;
}
.sidebar-bottom-tools {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(7px);
}
.side-section {
  position: relative;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
  padding: 0 0 16px;
}
.side-section:last-child { border-bottom: none; }
.side-section:has(.user-list) { border-bottom: none; }
.sidebar-bottom-tools .side-section:last-child { padding-bottom: 0; }
.room-title-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.room-title-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.room-action-btn {
  flex: 0 0 auto;
  min-width: 28px;
  height: 22px;
  margin-top: -2px;
  padding: 0 7px 3px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.78);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.room-action-btn:hover {
  border-color: rgba(124,106,247,.55);
  background: rgba(124,106,247,.18);
  color: var(--text);
}
#locate-btn {
  position: relative;
  top: -1px;
}
.sidebar-status-line {
  margin-top: 34px;
  transform: translateY(8px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.app-version,
.latency-monitor {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.app-version {
  min-width: 0;
  text-align: left;
}
.latency-monitor {
  flex: 0 0 auto;
  text-align: right;
  font-weight: 900;
}
.latency-monitor.latency-good { color: rgba(126, 243, 223, .86); }
.latency-monitor.latency-warn { color: rgba(255, 211, 127, .9); }
.latency-monitor.latency-bad { color: rgba(255, 143, 161, .92); }
.icon-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.icon-label img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}
.gear-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.gear-btn:hover { background: var(--surface-hover); color: var(--text); }
.side-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.user-list {
  display: grid;
  gap: 7px;
}
.friend-list, .game-list, .voice-list { display: grid; gap: 7px; }
.voice-side-section .btn-voice {
  width: 100%;
  margin-top: 0;
}
.voice-side-section.has-voice .btn-voice {
  margin-top: 8px;
}
.voice-side-section[hidden] { display: none; }
.voice-list:empty { display: none; }
.voice-card {
  position: relative;
  grid-template-columns: 36px minmax(0, 1fr);
  margin-bottom: 0;
  padding-right: 90px;
}
.voice-card .minor,
.voice-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-speaking-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(10,11,16,.95);
  border-radius: 50%;
  background: #5b5d67;
  box-shadow: 0 0 0 rgba(90,255,156,0);
}
.voice-speaking-dot.speaking {
  background: #45ef87;
  animation: voiceSpeakingPulse .82s ease-in-out infinite;
}
@keyframes voiceSpeakingPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(69,239,135,0); }
  50% { box-shadow: 0 0 12px rgba(69,239,135,.9); }
}
.voice-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.voice-control,
.voice-status-icon {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  color: rgba(255,255,255,.76);
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.voice-control {
  cursor: pointer;
}
.voice-control:hover {
  border-color: rgba(255,255,255,.28);
  background: linear-gradient(135deg, rgba(124,106,247,.3), rgba(255,255,255,.08));
  color: #fff;
}
.voice-control.active,
.voice-status-icon.active {
  border-color: rgba(255,93,114,.58);
  background: linear-gradient(135deg, rgba(151,32,54,.92), rgba(84,20,36,.82));
  color: #fff;
}
.voice-control.active::after,
.voice-status-icon.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-38deg);
}
.voice-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}
.voice-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.games-side-section {
  overflow: visible;
}
.game-start-wrap {
  position: relative;
}
.game-start-btn {
  width: 100%;
  justify-content: center;
  min-height: 42px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--border);
}
.game-start-btn:hover {
  background: var(--surface-hover);
}
.game-start-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.game-start-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10010;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(20,20,30,.98);
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
}
.game-start-menu[hidden] {
  display: none;
}
.game-start-menu button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}
.game-start-menu button:hover {
  background: var(--surface-hover);
}
.game-start-menu img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}
.person-row, .game-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.user-list .person-row { margin-bottom: 0; }
.person-row.role-user, .linked-half.role-user { background: linear-gradient(135deg, rgba(16,18,24,.95), rgba(35,38,48,.72)); }
.person-row.role-admin, .linked-half.role-admin { background: linear-gradient(135deg, rgba(86, 8, 25, .82), rgba(31, 11, 18, .9)); }
.person-row.role-developer, .linked-half.role-developer { background: linear-gradient(135deg, rgba(20, 45, 116, .84), rgba(10, 20, 48, .92)); }
.person-row.role-guide, .linked-half.role-guide { background: linear-gradient(135deg, rgba(9, 94, 58, .78), rgba(8, 35, 25, .92)); }
.person-row.role-owner, .linked-half.role-owner { background: linear-gradient(135deg, rgba(154, 105, 20, .86), rgba(76, 48, 13, .82) 48%, rgba(24, 18, 10, .94)); border-color: rgba(244, 190, 82, .34); }
.person-row.role-owner:hover { background: linear-gradient(135deg, rgba(184, 128, 26, .9), rgba(88, 56, 16, .86) 48%, rgba(28, 20, 11, .96)); }
.person-row:hover, .game-row:hover { background: var(--surface-hover); }
.person-row .user-avatar-wrap > img { width: 36px; height: 36px; border-radius: 0; object-fit: cover; border: 0; }
.person-name-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.person-game-name-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex: 0 0 auto;
}
.friend-list .person-row > img {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 0;
  object-fit: cover;
  border: 0;
  flex: 0 0 auto;
}
.friend-list .person-row {
  grid-template-columns: 36px minmax(0, 1fr) 38px 38px;
  gap: 8px;
}
.locate-action-btn {
  width: 38px;
  height: 38px;
  padding: 0;
}
.locate-action-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.locate-away {
  width: 38px;
  text-align: center;
  font-size: 11px;
}
.user-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  display: block;
}
.linked-row {
  display: grid;
  grid-template-columns: minmax(0, .94fr) auto minmax(0, 1fr);
  gap: 7px;
  min-height: 54px;
  border-color: rgba(124,106,247,.48);
  background: rgba(255,255,255,.035);
  padding: 4px;
}
.linked-half {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  border-radius: 6px;
  padding: 5px;
}
.linked-half:last-child {
  padding-left: 8px;
}
.linked-half strong,
.linked-half .minor {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-mark {
  align-self: center;
  justify-self: center;
  font-size: 13px;
  line-height: 1;
  margin: 0 2px;
  width: 26px;
  height: 26px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  cursor: pointer;
  filter: drop-shadow(0 0 4px rgba(124,106,247,.35));
}
.link-mark:hover { background: rgba(255,255,255,.1); }
.link-mark:disabled { cursor: default; opacity: .85; }
.link-mark:disabled:hover { background: rgba(255,255,255,.055); }
.link-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(10,11,16,.95);
  border-radius: 50%;
  background: #555;
}
.status-dot.on { background: var(--aqua); box-shadow: 0 0 10px rgba(39,211,195,.8); }
.user-game-badge {
  position: absolute;
  left: -5px;
  bottom: -5px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: rgba(11,12,18,.92);
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
}
.user-game-badge img {
  width: 12px;
  height: 12px;
  object-fit: contain;
}
.avatar {
  position: absolute;
  width: 150px;
  height: 150px;
  user-select: none;
  cursor: grab;
  border: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  object-fit: cover;
  z-index: 2;
}
.avatar:active { cursor: grabbing; }
.avatar-webcam-video {
  background: #05060a;
}
.avatar-webcam-video.avatar-webcam-self {
  transform: rotateY(180deg);
}
.avatar-hidden-behind-webcam {
  opacity: 0;
  pointer-events: none;
}
.avatar.avatar-flipping {
  animation: avatarHorizontalFlip .32s cubic-bezier(.4,0,.2,1);
  transform-origin: center;
  backface-visibility: hidden;
  pointer-events: none;
}
.avatar.avatar-materialize {
  animation: avatarMaterializeReveal .88s cubic-bezier(.18,.82,.28,1) both;
  pointer-events: none;
}
.avatar.avatar-dusting {
  animation: avatarDustReveal .78s cubic-bezier(.4,0,.22,1) forwards;
  pointer-events: none;
}
.avatar-pixel-layer {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}
.avatar-pixel-layer span {
  position: absolute;
  display: block;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(255,255,255,.16);
  will-change: transform, opacity;
}
.avatar-pixel-layer.build-in span {
  opacity: 0;
  transform: translate3d(calc(var(--dx) * -1), var(--dy), 0) scale(.55);
  animation: avatarPixelBuild .64s cubic-bezier(.19,.86,.24,1) var(--delay) forwards;
}
.avatar-pixel-layer.dust-out span {
  opacity: .95;
  transform: translate3d(0, 0, 0) scale(1);
  animation: avatarPixelDust .66s cubic-bezier(.34,0,.2,1) var(--delay) forwards;
}
@keyframes avatarMaterializeReveal {
  0% {
    opacity: 0;
    clip-path: inset(100% 0 0 0);
    filter: brightness(1.35) saturate(1.2);
  }
  55% { opacity: 1; }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    filter: brightness(1) saturate(1);
  }
}
@keyframes avatarDustReveal {
  0% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    filter: brightness(1.1) saturate(1.12);
  }
  100% {
    opacity: 0;
    clip-path: inset(100% 0 0 0);
    filter: brightness(.6) saturate(.6);
  }
}
@keyframes avatarHorizontalFlip {
  0% {
    transform: perspective(720px) rotateY(0deg);
    filter: brightness(1);
  }
  48% {
    transform: perspective(720px) rotateY(88deg);
    filter: brightness(1.24) saturate(1.1);
  }
  52% {
    transform: perspective(720px) rotateY(88deg);
    filter: brightness(1.24) saturate(1.1);
  }
  100% {
    transform: perspective(720px) rotateY(0deg);
    filter: brightness(1);
  }
}
@keyframes avatarPixelBuild {
  0% {
    opacity: 0;
    transform: translate3d(calc(var(--dx) * -1), var(--dy), 0) scale(.55);
  }
  70% {
    opacity: .95;
    transform: translate3d(0, 0, 0) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(.86);
  }
}
@keyframes avatarPixelDust {
  0% {
    opacity: .98;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) rotate(20deg) scale(.35);
  }
}
.avatar-name {
  position: absolute;
  z-index: 5;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
  color: var(--text);
  opacity: 0;
  transition: opacity .15s ease;
}
.avatar:hover + .avatar-name,
.avatar:hover ~ .avatar-name {
  opacity: 1;
}
.avatar-name.avatar-name-hidden { opacity: 0 !important; }
.avatar.webcam { border-radius: 4px; width: 150px; height: 150px; object-fit: cover; }
.avatar.avatar-pulse {
  animation: avatarPulse 1.45s ease-out;
}
@keyframes avatarPulse {
  0% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(255,255,255,0), 0 2px 12px rgba(0,0,0,.4);
  }
  12%, 48% {
    filter: brightness(1.22);
    box-shadow:
      0 0 0 3px rgba(255,255,255,.88),
      0 0 26px rgba(255,255,255,.72),
      0 0 48px rgba(124,106,247,.58),
      0 2px 12px rgba(0,0,0,.4);
  }
  30%, 100% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(255,255,255,0), 0 2px 12px rgba(0,0,0,.4);
  }
}
.typing-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  background: rgba(30,30,40,0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  z-index: 25;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.typing-bubble span {
  width: 5px;
  height: 5px;
  background: #ccc;
  border-radius: 50%;
  display: block;
  animation: typingBounce 1.1s infinite ease-in-out;
}
.typing-bubble span:nth-child(2) { animation-delay: .18s; }
.typing-bubble span:nth-child(3) { animation-delay: .36s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.chat-bubble {
  position: absolute;
  max-width: 200px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 20;
  border: 1px solid rgba(255,255,255,0.15);
}
.chat-bubble.chat-bubble-gif {
  width: max-content;
  max-width: min(260px, 22vw);
  padding: 6px;
  background: rgba(10,11,16,.76);
  border-color: rgba(255,255,255,.18);
}
.chat-bubble.chat-bubble-gif img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(210px, 24vh);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 7px;
}
.chat-bubble.chat-bubble-gesture {
  width: max-content;
  max-width: min(221px, 19vw);
  pointer-events: auto;
  cursor: pointer;
}
.chat-bubble.chat-bubble-gesture img {
  max-height: min(178px, 21vh);
}
.chat-bubble-gesture-text {
  margin-top: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}
.chat-bubble.show { opacity: 1; }
.chat-bubble::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}
.chat-bubble.br::before { top: -16px; left: 12px; border-bottom-color: rgba(255,255,255,0.12); }
.chat-bubble.bl::before { top: -16px; right: 12px; border-bottom-color: rgba(255,255,255,0.12); }
.chat-bubble.tr::before { bottom: -16px; left: 12px; border-top-color: rgba(255,255,255,0.12); }
.chat-bubble.tl::before { bottom: -16px; right: 12px; border-top-color: rgba(255,255,255,0.12); }
.game-list {
  margin-top: 9px;
}
.game-list[hidden] {
  display: none;
}
.game-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 0;
  background: linear-gradient(135deg, rgba(27,22,48,.88), rgba(19,17,32,.94));
  border-color: rgba(124,106,247,.42);
}
.game-row.active {
  border-color: rgba(124,106,247,.55);
  background: linear-gradient(135deg, rgba(33,25,64,.95), rgba(20,17,38,.96));
}
.game-row-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.game-row-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.game-row-title img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.game-row-state {
  align-self: center;
  justify-self: end;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(124,106,247,.42);
  background: rgba(124,106,247,.14);
  color: rgba(255,255,255,.86);
  font-size: 12px;
  font-weight: 900;
}
.game-row-players {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 24px;
  margin-top: 2px;
}
.game-row-players img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.38);
  background: #11131b;
  margin-right: -6px;
}
.game-btn {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  padding: 9px 10px;
}
.game-btn:hover { background: var(--surface-hover); }
.game-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}
.modal { position: fixed; inset: 0; display: none; place-items: center; background: rgba(0,0,0,.62); z-index: 20; padding: 20px; }
.modal.open { display: grid; }
.modal-box { width: min(520px, 100%); max-height: 78vh; overflow: auto; background: #12141d; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.room-effects-box { width: min(540px, 100%); }
.voice-device-box { width: min(430px, 100%); }
.voice-device-grid {
  display: grid;
  gap: 12px;
}
.voice-device-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.voice-device-actions .btn {
  width: auto;
  min-width: 118px;
}
.room-effect-current {
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid rgba(124,106,247,.26);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124,106,247,.14), rgba(0,0,0,.22));
}
.room-effects-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.room-effects-actions .btn {
  width: auto;
  min-width: 138px;
}
.room-edit-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 7;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124,106,247,.18), rgba(39,211,195,.08));
}
.room-edit-preview img,
.room-edit-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.room-edit-preview-empty {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}
.room-edit-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.room-edit-actions .btn-primary {
  justify-self: start;
}
.lobby-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10002;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 14px;
  border: 1px solid rgba(124,106,247,.38);
  border-radius: var(--radius-sm);
  background: rgba(16,17,25,.96);
  color: var(--text);
  box-shadow: 0 14px 38px rgba(0,0,0,.45);
  transform: translateY(12px);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.lobby-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.window-close {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: #d83d4b;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,.22), 0 4px 12px rgba(0,0,0,.22);
}
.window-close:hover { background: #f04d5c; }
.password-box {
  width: min(430px, 100%);
}
.password-box label {
  margin-bottom: 11px;
}
.password-status {
  min-height: 18px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}
.password-status.ok { color: #7ff3df; }
.password-status.error-text { color: #ffd7df; }
.password-status.working { color: #b8adff; }
.recovery-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(0,0,0,.22);
}
.recovery-code {
  padding: 10px 12px;
  border: 1px solid rgba(124,106,247,.42);
  border-radius: 7px;
  background: rgba(124,106,247,.12);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .03em;
  text-align: center;
}
.password-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}
.password-actions .btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a86ff);
  border-color: transparent;
  color: #fff;
  font-weight: 800;
}
.link-icon-box { width: min(560px, 100%); }
.link-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
}
.link-icon-grid button {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-items: center;
  min-height: 92px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}
.link-icon-grid button:hover,
.link-icon-grid button.selected {
  border-color: rgba(124,106,247,.68);
  background: rgba(124,106,247,.16);
}
.link-icon-grid img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.link-icon-grid .link-icon-none > span {
  width: 34px;
  height: 34px;
  border: 1px dashed rgba(255,255,255,.26);
  border-radius: 7px;
  background: rgba(0,0,0,.18);
}
.link-icon-grid .link-icon-none strong {
  font-size: 12px;
}
.admin-box {
  width: min(1220px, calc(100vw - 44px));
  max-height: 90vh;
  overflow: hidden;
  padding-bottom: 0;
}
.admin-dashboard {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: min(720px, calc(90vh - 86px));
  margin: 14px -18px -18px;
  border-top: 1px solid var(--border);
}
.admin-nav {
  min-width: 0;
  padding: 18px 0 22px;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(124,106,247,.07), transparent 26%),
    rgba(7,8,13,.58);
  overflow-y: auto;
}
.admin-nav-label {
  padding: 14px 18px 7px;
  color: rgba(255,255,255,.38);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.admin-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}
.admin-nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.045);
}
.admin-nav-item.active {
  color: #fff;
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(124,106,247,.2), rgba(124,106,247,.045));
}
.admin-nav-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}
.admin-nav-symbol {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(255,255,255,.78);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-.5px);
}
.admin-nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.75);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}
.admin-main {
  min-width: 0;
  padding: 26px 30px 30px;
  overflow: auto;
  background:
    radial-gradient(circle at 100% 0%, rgba(124,106,247,.1), transparent 32%),
    radial-gradient(circle at 0% 100%, rgba(39,211,195,.06), transparent 34%),
    rgba(10,11,17,.42);
}
.admin-section { display: none; }
.admin-section.active {
  display: block;
  animation: admin-pane-in .12s ease-out;
}
@keyframes admin-pane-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.admin-section-title {
  margin: 0;
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.12;
}
.admin-section-sub {
  max-width: 720px;
  margin: 6px 0 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.admin-summary-card,
.admin-panel {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
    rgba(5,6,10,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.admin-summary-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 17px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.admin-summary-card:hover {
  border-color: rgba(124,106,247,.38);
  background:
    linear-gradient(135deg, rgba(124,106,247,.12), rgba(255,255,255,.025)),
    rgba(5,6,10,.5);
}
.admin-summary-card span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.admin-summary-card strong {
  font-size: 34px;
  line-height: .95;
}
.admin-summary-card small {
  color: var(--text-muted);
  font-size: 12px;
}
.admin-panel {
  padding: 14px;
  margin-bottom: 14px;
}
.admin-panel h3 {
  margin: 0 0 12px;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-create,
.admin-user-row {
  display: grid;
  grid-template-columns: 1.1fr 1.35fr 1fr .8fr auto;
  gap: 9px;
  align-items: center;
  margin-bottom: 10px;
}
.admin-link-icon-create {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(240px, 1.4fr) auto;
  gap: 9px;
  align-items: center;
}
.admin-link-icon-create .admin-form-status {
  grid-column: 1 / -1;
}
.admin-link-icons {
  display: grid;
  gap: 8px;
}
.admin-scroll-list {
  max-height: min(430px, calc(90vh - 350px));
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}
.admin-scroll-list::-webkit-scrollbar {
  width: 6px;
}
.admin-scroll-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.035);
  border-radius: 999px;
}
.admin-scroll-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(124,106,247,.45);
}
.admin-scroll-list::-webkit-scrollbar-thumb:hover {
  background: rgba(124,106,247,.62);
}
.admin-link-icon-row {
  display: grid;
  grid-template-columns: 44px minmax(140px, .85fr) minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 8px;
  background: rgba(0,0,0,.2);
}
.admin-link-icon-row > img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  justify-self: center;
}
.admin-link-icon-row .admin-row-status {
  grid-column: 3 / -1;
}
.admin-user-row {
  grid-template-columns: minmax(180px, 1.45fr) minmax(110px, .75fr) minmax(140px, 1fr) auto auto;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 8px;
  background: rgba(0,0,0,.2);
}
.admin-created-meta {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.admin-created-meta > span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px 6px;
  border: 1px solid rgba(74, 222, 128, .34);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 197, 94, .28), rgba(255,255,255,.045));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  color: #eafff0;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
}
.admin-created-meta strong {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 850;
}
.admin-created-meta strong span {
  color: rgba(255,255,255,.52);
}
.admin-row-status,
.admin-form-status {
  min-height: 16px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}
.admin-row-status {
  grid-column: 2 / -1;
  margin-top: -3px;
}
.admin-form-status {
  grid-column: 1 / -1;
}
.admin-row-status.ok,
.admin-form-status.ok {
  color: #68f59b;
}
.admin-row-status.error,
.admin-form-status.error {
  color: #ff8fa1;
}
.admin-row-status.working,
.admin-form-status.working {
  color: #b8adff;
}
.admin-users { display: grid; gap: 8px; }
.admin-actions,
.admin-settings,
.admin-list,
.admin-export-options,
.admin-restore {
  display: grid;
  gap: 10px;
}
.admin-export-options {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 8px;
  background: rgba(0,0,0,.18);
}
.admin-export-choice {
  min-height: 42px;
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(124,106,247,.095), rgba(255,255,255,.035));
  color: var(--text);
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
}
.admin-export-choice:nth-of-type(2n) {
  background: linear-gradient(90deg, rgba(255,255,255,.062), rgba(255,255,255,.032));
}
.admin-export-choice:hover {
  border-color: rgba(124,106,247,.34);
  filter: brightness(1.08);
}
.admin-export-choice input {
  width: 14px;
  height: 14px;
  margin: 0;
  justify-self: start;
  align-self: center;
}
.admin-export-choice span {
  min-width: 0;
  justify-self: start;
}
.admin-export-subchoice {
  width: calc(100% - 22px);
  margin-left: 22px;
  color: rgba(255,255,255,.84);
}
.admin-export-subchoice:has(input:disabled) {
  opacity: .45;
}
.admin-export-options .btn {
  justify-self: end;
  width: auto;
}
.admin-settings {
  display: grid;
  gap: 14px;
}
.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.admin-settings-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(124,106,247,.075), rgba(255,255,255,.022)),
    rgba(0,0,0,.16);
}
.admin-settings-group:nth-child(2n) {
  background:
    linear-gradient(135deg, rgba(255,255,255,.052), rgba(255,255,255,.018)),
    rgba(0,0,0,.18);
}
.admin-settings-group h3 {
  margin: 0 0 12px;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.admin-settings-group-wide {
  grid-column: 1 / -1;
}
.admin-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.admin-settings-fields.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-settings-registration {
  align-items: end;
}
.admin-settings-registration .check-label {
  min-height: 41px;
  align-self: end;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(255,255,255,.045);
}
.auth-protection-fields {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.admin-settings-hint {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}
.admin-settings-actions {
  display: grid;
  gap: 8px;
}
.admin-settings-actions .btn { width: 100%; }
.admin-list {
  max-height: 360px;
  overflow: auto;
}
.admin-log-list { max-height: 520px; }
.admin-moderation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.admin-panel-wide { grid-column: 1 / -1; }
.admin-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0,0,0,.38), rgba(255,255,255,.025));
}
.admin-list-row strong,
.admin-list-row .minor {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .admin-box { width: min(96vw, 100%); }
  .admin-dashboard {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .admin-nav {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0;
  }
  .admin-nav-label { display: none; }
  .admin-nav-item {
    width: auto;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .admin-nav-item.active {
    border-bottom-color: var(--accent);
    border-left-color: transparent;
  }
  .admin-main { padding: 22px; }
  .admin-create,
  .admin-user-row,
  .admin-link-icon-create,
  .admin-link-icon-row,
  .admin-settings-grid,
  .admin-settings-fields,
  .admin-settings-fields.three,
  .auth-protection-fields,
  .admin-moderation-grid,
  .admin-summary-grid {
    grid-template-columns: 1fr;
  }
  .admin-panel-wide { grid-column: auto; }
}
.voice-note-box { width: min(380px, 100%); }
.host-action-box { width: min(560px, 100%); }
.host-target-line {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,106,247,.12), rgba(255,255,255,.04));
  color: var(--text);
  font-weight: 800;
}
.host-field {
  gap: 8px;
  margin-bottom: 14px;
}
.host-field textarea,
.host-field select {
  width: 100%;
  color: var(--text);
  background: rgba(255,255,255,.065);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
.host-field textarea {
  min-height: 128px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}
.host-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.host-action-footer .btn { flex: 0 0 auto; }
.host-duration-field { margin-bottom: 18px; }
.host-kick-submit { margin-top: 4px; }
.delete-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.delete-message-actions .btn {
  width: auto;
}
.ejection-list-wrap {
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ejection-list {
  display: grid;
  gap: 8px;
}
.ejection-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
}
.voice-note-status {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(255,255,255,.045);
}
.locate-box { width: min(620px, 100%); }
.locate-loading {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 13px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#ctx-menu,
#text-ctx-menu,
#msg-action-menu,
#tab-ctx-menu,
#room-action-menu,
#room-menu,
#emoji-picker {
  position: fixed;
  display: none;
  z-index: 10000;
  min-width: 168px;
  padding: 6px;
  background: rgba(20,20,30,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#media-picker {
  position: fixed;
  z-index: 10000;
  width: min(650px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 80px));
  padding: 12px;
  background: rgba(33, 26, 45, 0.98);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(143, 112, 255, .42);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.media-picker-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.media-picker-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}
.media-picker-tabs button.active {
  background: rgba(255,255,255,.1);
}
.media-search-row {
  margin-bottom: 10px;
}
.media-search-row input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid rgba(124,106,247,.8);
  border-radius: 8px;
  background: rgba(15,16,24,.78);
  color: var(--text);
  outline: none;
}
.media-panel {
  display: none;
  height: calc(100% - 94px);
}
.media-panel.active {
  display: block;
}
#media-picker.media-tab-emojis .media-search-row {
  display: none;
}
#media-picker.media-tab-emojis .media-panel {
  height: calc(100% - 44px);
}
#gif-picker {
  position: fixed;
  z-index: 10000;
  width: min(460px, calc(100vw - 24px));
  height: min(430px, calc(100vh - 80px));
  padding: 8px;
  background: rgba(20,20,30,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#ctx-menu.visible,
#text-ctx-menu.visible,
#msg-action-menu.visible,
#tab-ctx-menu.visible,
#room-action-menu.visible,
#room-menu.visible { display: block; }
#emoji-picker.visible {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 4px;
  min-width: 0;
}
.gif-search-row {
  display: flex;
  gap: 8px;
  padding: 4px;
}
.gif-search-row input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(124,106,247,.55);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}
.gif-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 112px;
  gap: 7px;
  height: calc(100% - 52px);
  padding: 4px;
  overflow-y: auto;
}
#media-panel-gifs .gif-results {
  height: 100%;
}
.gif-loading,
.gif-results > .minor {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: var(--muted);
  font-size: 13px;
}
.gif-result {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: rgba(255,255,255,.05);
  cursor: pointer;
}
.gif-result img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.gif-result:hover {
  border-color: rgba(124,106,247,.75);
  box-shadow: 0 0 0 1px rgba(124,106,247,.35);
}
.gesture-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 92px;
  gap: 10px;
  height: calc(100% - 58px);
  overflow-y: auto;
  padding: 2px 2px 8px;
}
.gesture-tile,
.gesture-upload-tile {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,.35);
}
.gesture-upload-tile {
  display: grid;
  place-content: center;
  gap: 4px;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}
.gesture-upload-tile span {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  margin: 0 auto;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 6px;
  font-size: 28px;
  line-height: 1;
}
.gesture-upload-tile small {
  font-size: 11px;
  color: var(--muted);
}
.gesture-upload-tile em {
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}
.gesture-upload-tile:disabled {
  cursor: not-allowed;
  opacity: .52;
}
.gesture-upload-tile:disabled::after {
  content: "Remove some gestures to make room.";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,.72);
  color: rgba(255,255,255,.88);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .14s ease, transform .14s ease;
}
.gesture-upload-tile:disabled:hover::after {
  opacity: 1;
  transform: translateY(0);
}
.gesture-upload-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 5px;
  display: none;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}
.gesture-upload-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7c6af7, #4ea1ff);
}
.gesture-upload-tile.uploading .gesture-upload-progress {
  display: block;
}
.gesture-play {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: rgba(0,0,0,.24);
  cursor: pointer;
}
.gesture-play img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}
.gesture-star,
.gesture-global,
.gesture-audio {
  position: absolute;
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(8,9,14,.72);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,.45);
}
.gesture-star {
  left: 6px;
  top: 6px;
  color: #ffd739;
  text-shadow: 0 0 8px rgba(255, 215, 57, .65);
}
.gesture-global {
  right: 6px;
  top: 6px;
  color: #32d7ff;
}
.gesture-global:disabled {
  cursor: default;
}
.gesture-tile:not(.public) .gesture-global {
  opacity: .38;
  filter: grayscale(1);
}
.gesture-audio {
  right: 6px;
  bottom: 6px;
  font-size: 13px;
  background:
    conic-gradient(#7c6af7 var(--progress, 0deg), rgba(255,255,255,.16) 0),
    rgba(8,9,14,.72);
}
.gesture-audio span {
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(8,9,14,.86);
}
.gesture-tile:hover {
  border-color: rgba(124,106,247,.85);
  box-shadow: 0 0 0 1px rgba(124,106,247,.35), 0 8px 24px rgba(0,0,0,.35);
}
.gesture-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.gesture-pager {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
}
.gesture-pager .btn {
  width: auto;
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
}
.gesture-pager .btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.gesture-pager span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.gesture-tray {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  margin-top: 4px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(0,0,0,.2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  height: 100%;
  overflow-y: auto;
}
.emoji-grid button {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  cursor: pointer;
  font-size: 21px;
}
.emoji-grid button:hover {
  background: rgba(124,106,247,.25);
  border-color: rgba(124,106,247,.55);
}
#ctx-menu button,
#text-ctx-menu button,
#msg-action-menu button,
#tab-ctx-menu button,
#room-action-menu button,
#room-menu button,
#room-menu a,
#emoji-picker button {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
}
.msg-react-row {
  display: grid;
  grid-template-columns: repeat(6, 30px);
  gap: 4px;
  padding: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}
.msg-react-row button {
  text-align: center !important;
  padding: 6px 0 !important;
  font-size: 15px !important;
}
.ctx-submenu-wrap {
  position: relative;
}
.ctx-divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}
#ctx-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.ctx-submenu {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  display: none;
  min-width: 168px;
  padding: 6px;
  background: rgba(20,20,30,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.ctx-submenu-wrap.open .ctx-submenu,
.ctx-submenu-wrap:hover .ctx-submenu {
  display: block;
}
#room-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
}
#room-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
}
#room-menu img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
#ctx-menu button:hover,
#text-ctx-menu button:hover,
#msg-action-menu button:hover,
#tab-ctx-menu button:hover,
#room-action-menu button:hover,
#room-menu button:hover,
#room-menu a:hover,
#emoji-picker button:hover { background: var(--surface-hover); }
#ctx-menu .danger,
#msg-action-menu .danger,
#tab-ctx-menu .danger,
#room-action-menu .danger { color: #ffd7df; }
.session-lock {
  position: fixed;
  inset: 0;
  z-index: 50000;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(520px 280px at 50% 38%, rgba(124,106,247,.13), transparent 72%),
    #000;
}
.session-lock.open { display: grid; }
.session-lock-box {
  width: min(390px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18,18,26,.98), rgba(5,5,8,.99));
  box-shadow: 0 24px 90px rgba(0,0,0,.78);
}
.session-lock-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 2px;
}
.session-lock-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}
.session-lock-brand strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}
.session-lock-brand span {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}
.session-lock-error {
  min-height: 17px;
  color: #ffd7df;
  font-size: 12px;
  font-weight: 700;
}
.session-lock-box .btn { width: 100%; }
.avatar.linked { box-shadow: 0 0 14px rgba(124,106,247,.45), 0 2px 12px rgba(0,0,0,.4); }
.stage-link-icon {
  position: absolute;
  z-index: 4;
  width: 44px;
  height: 44px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(10,11,16,.64);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 18px rgba(124,106,247,.35), 0 8px 18px rgba(0,0,0,.34);
  pointer-events: none;
  animation: stageLinkFadeIn .22s ease both;
  transition: opacity .22s ease, transform .22s ease;
}
.stage-link-icon.removing {
  opacity: 0;
  transform: scale(.82);
}
.stage-link-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
@keyframes stageLinkFadeIn {
  from { opacity: 0; transform: scale(.82); }
  to { opacity: 1; transform: scale(1); }
}
@media (max-width: 860px) {
  .topbar {
    padding-right: 0;
    padding-top: 64px;
  }
  .top-actions {
    top: 16px;
    right: 10px;
    width: min(230px, calc(100% - 20px));
  }
  .room-layout { display: block; height: 100%; }
  .main { height: 58%; padding: 6px; }
  .room-stage { top: 6px; left: 6px; right: 6px; }
  .divider { left: 6px; right: 6px; }
  .vertical-divider { display: none; }
  .chat-pane { left: 6px; right: 6px; bottom: 6px; }
  .sidebar {
    width: auto;
    min-width: 0;
    height: auto;
    max-height: calc(42vh - 12px);
    margin: 0 6px 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .create-row { grid-template-columns: 1fr; }
  .message { max-width: 92%; }
  .game-stage-layer { padding: 10px; }
  .game-stage-body {
    grid-template-columns: 82px minmax(220px, 1fr) 82px;
    gap: 8px;
  }
  .game-player-card {
    padding: 10px 6px;
    font-size: 11px;
  }
  .game-player-card img {
    width: 48px;
    height: 48px;
  }
}
