@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/vendor/inter/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/vendor/inter/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0e0f13;
  --bg-2: #121318;
  --panel: #17181d;
  --panel-2: #1e2026;
  --panel-3: #272930;
  --elev: #1c1d23;
  --seg-on: #2b2d35;
  --glass: rgba(23, 24, 29, 0.86);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.11);
  --line-3: rgba(255, 255, 255, 0.18);
  --text: #ececef;
  --text-2: #b4b6c0;
  --muted: #8c8f9b;
  --faint: #666975;
  --accent: #6e7bff;
  --accent-hover: #8290ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(110, 123, 255, 0.16);
  --accent-text: #a8b0ff;
  --accent-2: #ff8fa3;
  --good: #3ecf8e;
  --warn: #f5a524;
  --bad: #f2555a;
  --good-soft: rgba(62, 207, 142, 0.14);
  --warn-soft: rgba(245, 165, 36, 0.14);
  --bad-soft: rgba(242, 85, 90, 0.14);
  --badge: #ef4f5f;
  --offline: #5d606c;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32), 0 2px 8px rgba(0, 0, 0, 0.16);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.36), 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.24);
  --focus: 0 0 0 3px rgba(110, 123, 255, 0.4);
  --tip-bg: #0a0b0e;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --side-w: 360px;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f3f4f7;
  --bg-2: #f7f8fa;
  --panel: #ffffff;
  --panel-2: #f4f5f8;
  --panel-3: #e9ebf0;
  --elev: #ffffff;
  --seg-on: #ffffff;
  --glass: rgba(255, 255, 255, 0.9);
  --line: rgba(17, 19, 30, 0.08);
  --line-2: rgba(17, 19, 30, 0.12);
  --line-3: rgba(17, 19, 30, 0.2);
  --text: #16171d;
  --text-2: #464955;
  --muted: #6a6d79;
  --faint: #93959f;
  --accent: #5865f2;
  --accent-hover: #4752e0;
  --accent-soft: rgba(88, 101, 242, 0.11);
  --accent-text: #4752e0;
  --good: #1f9d68;
  --warn: #c77d06;
  --bad: #dc3a40;
  --good-soft: rgba(31, 157, 104, 0.1);
  --warn-soft: rgba(199, 125, 6, 0.11);
  --bad-soft: rgba(220, 58, 64, 0.09);
  --offline: #a3a6b0;
  --shadow-sm: 0 1px 2px rgba(17, 19, 30, 0.08), 0 2px 8px rgba(17, 19, 30, 0.05);
  --shadow: 0 8px 24px rgba(17, 19, 30, 0.1), 0 2px 6px rgba(17, 19, 30, 0.06);
  --shadow-lg: 0 24px 64px rgba(17, 19, 30, 0.16), 0 6px 16px rgba(17, 19, 30, 0.08);
  --focus: 0 0 0 3px rgba(88, 101, 242, 0.28);
  --tip-bg: #16171d;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font), var(--emoji);
  font-size: 14px;
  line-height: 1.45;
  font-feature-settings: 'cv11', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

#app {
  position: fixed;
  inset: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

img.emoji {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.011em;
}

p {
  margin: 0 0 10px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

::selection {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  background: var(--panel-2);
  color: var(--text-2);
  font: 600 11px/1 var(--font);
  text-align: center;
  white-space: nowrap;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--line-3);
}

.brand-mark {
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  background: linear-gradient(140deg, #8794ff 0%, #6b5cff 55%, #a46bff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 16px rgba(107, 92, 255, 0.32);
}

.brand-mark.lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 22px;
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 17px;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--good);
  vertical-align: 1px;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent);
  animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
  70% {
    box-shadow: 0 0 0 6px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* Avatar thumbnails (pixel characters or emoji) */

.av-thumb {
  flex: none;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ring, var(--accent)) 22%, var(--panel-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ring, var(--accent)) 26%, transparent);
  vertical-align: middle;
}

.px-av-thumb:not(.full) {
  place-items: start center;
}

.px-av-thumb canvas,
canvas.px-thumb {
  display: block;
  image-rendering: pixelated;
}

img.av-thumb.emoji-thumb {
  padding: 2px;
  object-fit: contain;
}

/* Controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font: 500 13.5px/1.2 var(--font);
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s, opacity 0.15s;
}

.btn i {
  font-size: 0.92em;
}

.btn:hover {
  background: var(--panel-3);
  border-color: var(--line-3);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn.busy {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.danger {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 30%, transparent);
  color: var(--bad);
}

.btn.danger:hover {
  background: color-mix(in srgb, var(--bad) 22%, transparent);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn.ghost:hover {
  background: var(--panel-2);
  color: var(--text);
}

.btn.small {
  min-height: 28px;
  padding: 4px 10px;
  gap: 6px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn.big {
  min-height: 42px;
  padding: 10px 20px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 10px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex: none;
}

.icon-btn:hover {
  background: var(--panel-3);
  color: var(--text);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn.small {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 13px;
}

.icon-btn.danger:hover {
  background: var(--bad-soft);
  color: var(--bad);
}

.input {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  font: 400 14px/1.4 var(--font), var(--emoji);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

:root[data-theme='light'] .input {
  background-color: var(--panel);
}

.input::placeholder {
  color: var(--faint);
}

.input:hover {
  border-color: var(--line-3);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.input.small {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12.5px;
  width: auto;
}

.input.color {
  padding: 3px;
  height: 36px;
}

textarea.input {
  resize: vertical;
  line-height: 1.45;
}

input[type='search'].input::-webkit-search-cancel-button {
  filter: grayscale(1) opacity(0.6);
}

.input-wrap {
  position: relative;
}

.input-wrap.has-icon .input {
  padding-left: 36px;
}

.input-wrap:has(.peek) .input {
  padding-right: 42px;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 13px;
  pointer-events: none;
  transition: color 0.15s;
}

.input-wrap:focus-within .input-icon {
  color: var(--accent-text);
}

.peek {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--faint);
  font-size: 13px;
  cursor: pointer;
}

.peek:hover,
.peek.on {
  color: var(--text);
  background: var(--panel-3);
}

.search-field {
  position: relative;
}

.search-field > i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 12px;
  pointer-events: none;
}

.search-field .input {
  padding-left: 34px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  min-width: 0;
}

.field-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}

.form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bad);
  font-weight: 500;
  font-size: 13px;
}

.form-error:empty {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
  margin: 6px 0 12px;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

:root[data-theme='light'] .seg {
  background: var(--panel-3);
  border-color: transparent;
}

.seg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 500 13px/1.2 var(--font);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.seg-btn i {
  font-size: 12px;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--seg-on);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 0 1px var(--line);
}

.seg.small .seg-btn {
  min-height: 26px;
  padding: 3px 10px;
  font-size: 12.5px;
}

.seg-badge,
.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--badge);
  color: #fff;
  font: 600 11px/18px var(--font);
  text-align: center;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: capitalize;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.chip:hover {
  border-color: var(--line-3);
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.chip-none {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--line-2);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--accent);
}

.range {
  --fill: 0%;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  accent-color: var(--accent);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--fill), var(--panel-3) var(--fill));
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s;
}

.range:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

.range:focus-visible {
  outline: none;
}

.range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), var(--focus);
}

.range::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: var(--panel-3);
}

.range::-moz-range-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--accent);
}

.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--panel-3);
  overflow: hidden;
  margin: 2px 0 6px;
}

.meter-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--good), #8fe3bd 70%, var(--warn));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.06s linear;
}

.switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: var(--panel-3);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background 0.2s, box-shadow 0.2s;
}

.switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch-ui {
  background: var(--accent);
  box-shadow: none;
}

.switch input:checked + .switch-ui::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch-ui {
  box-shadow: var(--focus);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fatal {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  height: 100%;
  text-align: center;
  padding: 24px;
}

.fatal h1 {
  font-size: 20px;
}

/* Login */

.login-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden auto;
  padding: 32px 16px 120px;
  isolation: isolate;
  background: var(--bg);
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--bg);
}

.glow {
  position: absolute;
  width: 56vmax;
  height: 56vmax;
  border-radius: 50%;
  opacity: 0.5;
  filter: blur(40px);
  animation: glowDrift 26s ease-in-out infinite alternate;
}

.glow.g1 {
  left: -18vmax;
  top: -22vmax;
  background: radial-gradient(circle, rgba(104, 116, 255, 0.55), transparent 62%);
}

.glow.g2 {
  right: -20vmax;
  top: 4vmax;
  background: radial-gradient(circle, rgba(170, 96, 255, 0.4), transparent 62%);
  animation-duration: 32s;
  animation-delay: -8s;
}

.glow.g3 {
  left: 18vmax;
  bottom: -30vmax;
  background: radial-gradient(circle, rgba(46, 196, 168, 0.3), transparent 62%);
  animation-duration: 38s;
  animation-delay: -16s;
}

:root[data-theme='light'] .glow {
  opacity: 0.35;
}

@keyframes glowDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(6vmax, 4vmax) scale(1.08);
  }
  100% {
    transform: translate(-4vmax, 7vmax) scale(0.96);
  }
}

.login-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.login-scene {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 192px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}

.login-scene.ready {
  opacity: 1;
}

.scene-floor {
  position: absolute;
  left: 0;
  bottom: 0;
  image-rendering: pixelated;
  filter: saturate(0.85) brightness(0.62);
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.75) 45%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.75) 45%, #000 100%);
}

:root[data-theme='light'] .scene-floor {
  filter: saturate(0.9) brightness(1);
}

.scene-char {
  position: absolute;
  left: 0;
  image-rendering: pixelated;
  will-change: transform;
  filter: brightness(0.92);
}

.login-card {
  position: relative;
  width: min(400px, 100%);
  padding: 32px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg), inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
  color: var(--text);
  animation: cardIn 0.5s var(--ease);
}

.login-card.done {
  transform: scale(0.97);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
}

.login-card.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  margin-bottom: 24px;
}

.login-brand .brand-mark {
  margin-bottom: 12px;
}

.login-title {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.login-sub {
  color: var(--muted);
  font-size: 13.5px;
}

.login-form .seg {
  margin-bottom: 20px;
}

.login-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}

.login-note i {
  margin-top: 2px;
  color: var(--accent-text);
}

.login-form .btn.primary {
  width: 100%;
  margin-top: 8px;
}

.login-form .btn.primary i {
  transition: transform 0.15s var(--ease);
}

.login-form .btn.primary:hover i {
  transform: translateX(2px);
}

.login-form .form-error {
  margin-bottom: 8px;
}

.slack-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slack-btn {
  width: 100%;
  gap: 10px;
  background: #4a154b;
  border-color: #4a154b;
  color: #fff;
  text-decoration: none;
}

.slack-btn:hover {
  background: #611f64;
  border-color: #611f64;
  color: #fff;
}

.slack-btn .fa-brands {
  font-size: 18px;
}

.slack-switch {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
}

.slack-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.slack-switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slack-switch-actions .btn {
  flex: 1 1 140px;
  gap: 8px;
  text-decoration: none;
}

.slack-switch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.slack-switch-link:hover {
  color: inherit;
}

.login-fine {
  display: flex;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.login-fine i {
  margin-top: 2px;
}

.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.login-or::before,
.login-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

.login-more summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
  list-style: none;
  padding: 4px;
}

.login-more summary::-webkit-details-marker {
  display: none;
}

.login-more[open] summary {
  margin-bottom: 14px;
}

/* Lobby */

.lobby-screen {
  position: fixed;
  inset: 0;
  overflow: auto;
  background: radial-gradient(90% 60% at 10% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), radial-gradient(70% 60% at 100% 100%, rgba(170, 96, 255, 0.08), transparent 60%), var(--bg);
  padding: 32px 16px;
  display: grid;
  place-items: center;
  transition: opacity 0.22s;
}

.lobby-screen.leaving {
  opacity: 0;
}

.lobby-card {
  width: min(1040px, 100%);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: cardIn 0.45s var(--ease);
}

.lobby-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.lobby-head h1 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.lobby-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
}

.lobby-devices {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

:root[data-theme='light'] .lobby-devices {
  background: var(--panel-2);
}

.lobby-devices h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.lobby-devices .field {
  margin-bottom: 12px;
}

.lobby-cam {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-3);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.lobby-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: none;
}

.lobby-cam.on .lobby-video {
  display: block;
}

.lobby-cam-off {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}

.lobby-cam.on .lobby-cam-off {
  display: none;
}

.dev-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.field .dev-row,
.dev-row .field {
  margin-bottom: 0;
}

.dev-row .field {
  flex: 1;
  min-width: 0;
}

.dev-row:has(> .field) {
  align-items: flex-end;
}

.dev-row > .input,
.dev-row > .dd {
  flex: 1;
  min-width: 0;
}

.dev-row .btn {
  flex: none;
}

.dev-slot {
  flex: 1;
  min-width: 0;
}

.dev-msg {
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 8px;
}

.dev-msg:empty {
  display: none;
}

.lobby-tips {
  display: grid;
  gap: 8px;
  margin: 6px 0 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
}

.lobby-tips div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lobby-tips i,
.lobby-tips kbd {
  width: 20px;
  min-width: 20px;
  color: var(--muted);
  font-size: 13px;
}

.lobby-tips kbd {
  font-size: 10.5px;
  color: var(--text-2);
}

.lobby-devices .btn.primary {
  width: 100%;
}

.lobby-devices .btn.primary i {
  transition: transform 0.15s var(--ease);
}

.lobby-devices .btn.primary:hover i {
  transform: translateX(2px);
}

/* Avatar editor */

.avatar-editor {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
}

.ae-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.ae-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pv-stage {
  position: relative;
  width: 240px;
  height: 250px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #e9cda4 0, #e0c08f 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.pv-floor {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 100% 12px;
}

.pv-avatar {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
}

.pv-shadow {
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 80px;
  height: 18px;
  margin-left: -40px;
  border-radius: 50%;
  background: rgba(60, 40, 20, 0.22);
  box-shadow: 0 0 0 4px var(--ring);
  opacity: 0.9;
}

.pv-body {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  animation: breathe 2.6s ease-in-out infinite;
}

.pv-stage.walking .pv-body {
  animation: waddle 0.42s ease-in-out infinite;
}

.pv-face {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.2));
}

.pv-hat {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 64px;
  height: 64px;
  margin-left: -32px;
}

.pv-name {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 10px;
  background: rgba(20, 22, 36, 0.85);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-left: 4px solid var(--tag);
  white-space: nowrap;
}

.pv-trail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  height: 30px;
}

.pv-particle {
  position: absolute;
  bottom: 0;
  opacity: 0;
  animation: pvTrail 1.6s ease-out infinite;
}

.pv-particle:nth-child(1) {
  left: 30%;
}
.pv-particle:nth-child(2) {
  left: 42%;
  animation-delay: 0.4s;
}
.pv-particle:nth-child(3) {
  left: 56%;
  animation-delay: 0.8s;
}
.pv-particle:nth-child(4) {
  left: 66%;
  animation-delay: 1.2s;
}

@keyframes pvTrail {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) scale(1.1);
  }
}

/* Emoji picker */

.emoji-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel-2);
  border-radius: 14px;
  padding: 8px;
}

.ep-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.ep-tab {
  border: 0;
  background: transparent;
  padding: 6px;
  border-radius: 9px;
  cursor: pointer;
  opacity: 0.6;
}

.ep-tab.active,
.ep-tab:hover {
  opacity: 1;
  background: var(--panel-3);
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 2px;
  overflow-y: auto;
  align-content: start;
}

.ep-item {
  display: grid;
  place-items: center;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.1s, background 0.12s;
}

.ep-item:hover {
  background: var(--panel-3);
  transform: scale(1.12);
}

.ep-item.selected {
  border-color: var(--accent);
  background: var(--panel-3);
}

.ep-empty {
  grid-column: 1 / -1;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.emoji-pop {
  position: fixed;
  z-index: 200;
  width: 300px;
  padding: 10px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ep-quick {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.ep-quick .ep-item {
  height: 34px;
}

/* World */

.world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: default;
}

.world.panning {
  cursor: grabbing;
}

.stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.floor-chunk {
  position: absolute;
  display: block;
}

.entities-layer {
  z-index: 1;
}

.labels-layer {
  z-index: 2;
}

.fx-layer {
  z-index: 4;
}

.tool-layer {
  z-index: 5;
}

.labels-layer,
.trail-layer,
.fx-layer,
.tool-layer {
  pointer-events: none;
}

.world.show-grid .tool-layer,
.world.building .tool-layer,
.world.mapping .tool-layer {
  background-image: linear-gradient(to right, rgba(20, 24, 40, 0.13) 1px, transparent 1px), linear-gradient(to bottom, rgba(20, 24, 40, 0.13) 1px, transparent 1px);
  background-size: 48px 48px;
}

.zone-label {
  position: absolute;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1.5px solid color-mix(in srgb, var(--zc) 55%, transparent);
  color: #4b5068;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(20, 22, 40, 0.08);
}

.zl-icon {
  width: 14px;
  height: 14px;
}

.portal-mark {
  position: absolute;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.portal-swirl {
  width: 30px;
  height: 30px;
  opacity: 0.75;
  animation: spin 4s linear infinite;
  filter: drop-shadow(0 0 6px rgba(181, 140, 255, 0.9));
}

.shade {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 3;
}

.shade.on {
  opacity: 1;
}

.shade path {
  fill: rgba(14, 16, 32, 0.4);
}

.path-mark {
  position: absolute;
  width: 48px;
  height: 48px;
  pointer-events: none;
}

.path-mark::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(124, 140, 255, 0.6);
}

.path-mark.pulse::before {
  animation: markPulse 0.9s ease-out infinite;
}

@keyframes markPulse {
  0% {
    transform: scale(0.4);
    opacity: 1;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

/* Objects */

.obj {
  position: absolute;
  transition: opacity 0.2s, transform 0.2s;
}

.obj.removing {
  opacity: 0;
  transform: scale(0.8);
}

.obj.interactive {
  cursor: pointer;
}

.obj-emoji,
.obj-deco,
.obj-base {
  position: absolute;
  pointer-events: none;
}

.obj .obj-emoji {
  transform: scale(var(--grow, 1));
  transform-origin: 50% 90%;
  filter: drop-shadow(0 3px 2px rgba(20, 22, 40, 0.18));
}

.obj-emoji.float {
  animation: floaty 3.4s ease-in-out infinite;
}

.obj-emoji.flicker {
  animation: flicker 0.6s steps(3) infinite alternate;
}

@keyframes floaty {
  50% {
    transform: translateY(-6px) rotate(3deg);
  }
}

@keyframes flicker {
  to {
    transform: scale(1.06, 0.95) translateY(1px);
    filter: drop-shadow(0 0 10px rgba(255, 150, 40, 0.8)) brightness(1.08);
  }
}

.obj-shadow {
  position: absolute;
  height: 11px;
  border-radius: 50%;
  background: rgba(20, 22, 40, 0.2);
  filter: blur(1px);
  pointer-events: none;
}

.obj-shadow.soft {
  left: 8px;
  right: 8px;
  bottom: 3px;
  width: auto;
  top: auto;
}

.obj-shadow.big {
  left: 10%;
  right: 10%;
  bottom: 4px;
  top: auto;
  width: auto;
  height: 22px;
}

.obj-stand {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 6px;
  height: 18px;
  margin-left: -3px;
  background: #8a8fa3;
  border-radius: 3px;
}

.obj.hl > :not(.obj-shadow):not(.obj-tag) {
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 5px #ffd84d) drop-shadow(0 0 10px rgba(255, 216, 77, 0.6));
  animation: hlPulse 1.4s ease-in-out infinite;
}

@keyframes hlPulse {
  50% {
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 9px #ffd84d) drop-shadow(0 0 16px rgba(255, 216, 77, 0.7));
  }
}

.obj.erase-target > :not(.obj-shadow) {
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px var(--accent));
}

.world[data-tool='erase'] .obj.erase-target > :not(.obj-shadow) {
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px var(--bad)) sepia(0.4);
}

.world.building .obj {
  cursor: pointer;
}

.obj.ghost {
  opacity: 0.75;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(62, 207, 142, 0.9));
}

.obj.ghost::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px dashed var(--good);
  border-radius: 6px;
  background: rgba(62, 207, 142, 0.12);
}

.obj.ghost.bad {
  opacity: 0.55;
  filter: drop-shadow(0 0 4px rgba(255, 92, 122, 0.9)) grayscale(0.6);
}

.obj.ghost.bad::after {
  border-color: var(--bad);
  background: rgba(255, 92, 122, 0.15);
}

.obj-tag {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 120%;
  padding: 1px 7px;
  border-radius: 7px;
  background: rgba(20, 22, 36, 0.82);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
}

.obj-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
}

.obj-tag.offline .dot {
  background: #8a8fa3;
}

.obj-tag.offline {
  opacity: 0.8;
}

.obj-tag .badge {
  min-width: 14px;
  height: 14px;
  font-size: 9px;
}

.obj-music img {
  position: absolute;
  width: 18px;
  height: 18px;
  top: -14px;
  animation: notes 2.2s ease-out infinite;
  pointer-events: none;
}

.obj-music .n1 {
  left: 4px;
}

.obj-music .n2 {
  right: 2px;
  animation-delay: 1.1s;
}

@keyframes notes {
  0% {
    transform: translateY(8px) scale(0.6) rotate(-10deg);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translateY(-26px) scale(1) rotate(12deg);
    opacity: 0;
  }
}

.obj.playing .obj-emoji,
.obj.playing .machine {
  animation: bop 0.55s ease-in-out infinite;
}

@keyframes bop {
  50% {
    transform: scale(1.04, 0.97);
  }
}

/* Box furniture */

.box {
  position: absolute;
  background: var(--b);
  box-shadow: 0 6px 8px -2px rgba(20, 22, 40, 0.22);
}

.box-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  background: var(--a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.05);
}

.box.round,
.box.round .box-top {
  border-radius: 50%;
}

.chair {
  position: absolute;
  inset: 9px 9px 5px;
}

.chair-seat {
  position: absolute;
  inset: 4px 2px 0;
  border-radius: 11px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--a) 80%, #fff), var(--a) 55%, var(--b));
  box-shadow: 0 4px 6px rgba(20, 22, 40, 0.25);
}

.chair-back {
  position: absolute;
  left: 3px;
  right: 3px;
  height: 9px;
  border-radius: 6px;
  background: var(--b);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.chair.down .chair-back {
  top: -2px;
}

.chair.up .chair-back {
  bottom: -5px;
}

.couch {
  position: absolute;
  inset: 3px 2px 2px;
}

.couch-back {
  position: absolute;
  left: 0;
  right: 0;
  height: 15px;
  border-radius: 10px;
  background: var(--b);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.couch.down .couch-back {
  top: 0;
}

.couch.up .couch-back {
  bottom: 0;
}

.couch-arm {
  position: absolute;
  top: 4px;
  bottom: 2px;
  width: 9px;
  border-radius: 8px;
  background: var(--b);
}

.couch-arm.l {
  left: 0;
}

.couch-arm.r {
  right: 0;
}

.couch-seat {
  position: absolute;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 2px;
  border-radius: 8px;
}

.couch.down .couch-seat {
  top: 12px;
  bottom: 4px;
}

.couch.up .couch-seat {
  top: 2px;
  bottom: 13px;
}

.couch-cushion {
  flex: 1;
  border-radius: 8px;
  background: var(--a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 2px 3px rgba(0, 0, 0, 0.12);
}

.couch,
.bean,
.bench {
  filter: drop-shadow(0 4px 3px rgba(20, 22, 40, 0.18));
}

.bean {
  position: absolute;
  inset: 6px 5px 4px;
  border-radius: 48% 52% 44% 46%;
  background: radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--a) 60%, #fff), var(--a) 45%, var(--b));
}

.bench {
  position: absolute;
  inset: 12px 3px 8px;
  border-radius: 6px;
  background: var(--b);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 3px;
}

.bench-slat {
  height: 6px;
  border-radius: 3px;
  background: var(--a);
}

.shelf {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 4px;
  top: -26px;
  border-radius: 6px 6px 3px 3px;
  background: var(--b);
  box-shadow: 0 6px 8px -2px rgba(20, 22, 40, 0.25);
}

.shelf-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  border-radius: 6px 6px 0 0;
  background: color-mix(in srgb, var(--a) 70%, #fff);
}

.shelf-front {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 10px;
  bottom: 4px;
  border-radius: 3px;
  background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--b) 75%, #000) 0 2px, transparent 2px 20px), color-mix(in srgb, var(--b) 85%, #000);
}

.shelf-front .obj-deco {
  margin-top: 10px;
}

.board {
  position: absolute;
  left: 4px;
  right: 4px;
  top: -30px;
  bottom: 8px;
}

.board-panel {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: var(--board);
  border: 3px solid var(--frame);
  box-shadow: 0 6px 8px -3px rgba(20, 22, 40, 0.3);
}

.board-panel .obj-deco {
  margin-top: 22px;
}

.board.screen .board-panel {
  background: linear-gradient(135deg, #34406a, #151a28 70%);
  box-shadow: inset 0 0 14px rgba(124, 140, 255, 0.35), 0 6px 8px -3px rgba(20, 22, 40, 0.3);
}

.board-leg {
  position: absolute;
  bottom: -8px;
  width: 4px;
  height: 12px;
  border-radius: 2px;
  background: var(--frame);
}

.board-leg.l {
  left: 12px;
}

.board-leg.r {
  right: 12px;
}

.cooler {
  position: absolute;
  left: 13px;
  right: 13px;
  top: -16px;
  bottom: 6px;
}

.cooler-bottle {
  position: absolute;
  left: 3px;
  right: 3px;
  top: 0;
  height: 26px;
  border-radius: 9px 9px 4px 4px;
  background: linear-gradient(90deg, rgba(120, 190, 255, 0.85), rgba(190, 230, 255, 0.95));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.cooler-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  bottom: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, #e7ebf2, #fdfdff);
  box-shadow: 0 4px 6px rgba(20, 22, 40, 0.2);
}

.cooler-tap {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 8px;
  height: 6px;
  margin-left: -4px;
  border-radius: 2px;
  background: #5aa9f0;
}

.gong {
  position: absolute;
  inset: -18px 6px 6px;
}

.gong-frame {
  position: absolute;
  inset: 0;
  border: 4px solid #8a5a3a;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.gong-disc {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff2b0, #e8b84a 40%, #b07a22 75%, #8a5a1a);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.obj.hl .gong-disc,
.obj:hover .gong-disc {
  animation: gongSwing 1.6s ease-in-out infinite;
}

@keyframes gongSwing {
  25% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(6deg);
  }
}

.tank {
  position: absolute;
  left: 4px;
  right: 4px;
  top: -14px;
  bottom: 6px;
}

.tank-water {
  position: absolute;
  inset: 0 0 8px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(150, 220, 255, 0.9), rgba(70, 150, 230, 0.95));
  border: 3px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 -8px 0 rgba(240, 210, 150, 0.8);
}

.tank-water .obj-deco {
  margin-top: 6px;
}

.tank-base {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  border-radius: 3px;
  background: #3d4458;
}

.obj-deco.swim {
  animation: swim 7s ease-in-out infinite alternate;
}

@keyframes swim {
  0% {
    transform: translateX(-10px) scaleX(-1);
  }
  48% {
    transform: translateX(14px) scaleX(-1);
  }
  52% {
    transform: translateX(14px) scaleX(1);
  }
  100% {
    transform: translateX(-10px) scaleX(1);
  }
}

.cherry {
  position: absolute;
  inset: 0;
}

.cherry-trunk {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 16px;
  height: 46px;
  margin-left: -8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #7a4f36, #9c6a4a);
}

.cherry-crown {
  position: absolute;
  left: -14px;
  right: -14px;
  top: -62px;
  height: 120px;
  filter: drop-shadow(0 6px 4px rgba(120, 40, 80, 0.25));
  animation: sway 6s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.cherry-crown span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd6e6, #ff9fc6 50%, #f27bb0);
}

.cherry-crown span:nth-child(1) {
  left: 4%;
  top: 30%;
  width: 46%;
  height: 50%;
}
.cherry-crown span:nth-child(2) {
  left: 30%;
  top: 4%;
  width: 46%;
  height: 52%;
}
.cherry-crown span:nth-child(3) {
  right: 2%;
  top: 26%;
  width: 46%;
  height: 52%;
}
.cherry-crown span:nth-child(4) {
  left: 22%;
  top: 40%;
  width: 58%;
  height: 50%;
}
.cherry-crown span:nth-child(5) {
  left: 44%;
  top: 22%;
  width: 26%;
  height: 28%;
  background: radial-gradient(circle, #fff1f6, #ffc3da);
}

@keyframes sway {
  50% {
    transform: rotate(1.5deg);
  }
}

.machine {
  position: absolute;
  left: 6px;
  right: 6px;
  top: -8px;
  bottom: 5px;
  filter: drop-shadow(0 5px 4px rgba(20, 22, 40, 0.25));
}

.machine.tall {
  top: -34px;
}

.machine-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  border-radius: 6px 6px 0 0;
  background: color-mix(in srgb, var(--m-a) 70%, #fff);
}

.machine-front {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  bottom: 0;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--m-a), var(--m-b));
}

.machine-screen {
  position: absolute;
  left: 5px;
  right: 5px;
  top: 5px;
  height: 40%;
  border-radius: 4px;
  background: var(--m-screen);
}

.machine:not(.tall) .machine-screen {
  display: none;
}

.machine-front .obj-deco {
  margin-top: 10px;
}

.felt {
  position: absolute;
  inset: 4px 3px 5px;
  border-radius: 9px;
  background: var(--rim);
  box-shadow: 0 6px 8px -2px rgba(20, 22, 40, 0.3);
}

.felt-surface {
  position: absolute;
  inset: 5px;
  border-radius: 5px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--felt) 85%, #fff), var(--felt));
}

.felt-net {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 4px;
  margin-left: -2px;
  background: #f4f6fa;
  border-radius: 2px;
}

.felt-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: rgba(255, 255, 255, 0.7);
}

.felt-pocket {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a1d28;
}

.felt-pocket.tl {
  left: 2px;
  top: 2px;
}
.felt-pocket.tr {
  right: 2px;
  top: 2px;
}
.felt-pocket.bl {
  left: 2px;
  bottom: 2px;
}
.felt-pocket.br {
  right: 2px;
  bottom: 2px;
}
.felt-pocket.tm {
  left: 50%;
  top: 1px;
  margin-left: -5px;
}
.felt-pocket.bm {
  left: 50%;
  bottom: 1px;
  margin-left: -5px;
}

.felt-rod {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: #c8ccd8;
  border-radius: 2px;
}

.obj-piano {
  position: absolute;
  inset: -10px 3px 5px;
  border-radius: 7px;
  background: linear-gradient(180deg, #2d2f3a, #14151c);
  box-shadow: 0 6px 8px -2px rgba(20, 22, 40, 0.35);
  overflow: hidden;
}

.obj-piano-lid {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 4px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #4a4d5e, #23252f);
}

.obj-piano-keys {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 22px;
  display: flex;
  gap: 1px;
  background: #14151c;
}

.obj-piano-keys span {
  flex: 1;
  background: linear-gradient(180deg, #fff, #e8e9ef);
  border-radius: 0 0 2px 2px;
  position: relative;
}

.obj-piano-keys span:nth-child(7n + 1)::after,
.obj-piano-keys span:nth-child(7n + 2)::after,
.obj-piano-keys span:nth-child(7n + 4)::after,
.obj-piano-keys span:nth-child(7n + 5)::after,
.obj-piano-keys span:nth-child(7n + 6)::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 0;
  width: 5px;
  height: 12px;
  background: #14151c;
  z-index: 1;
  border-radius: 0 0 1px 1px;
}

.rug {
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  background: var(--a);
  box-shadow: 0 2px 4px rgba(20, 22, 40, 0.12);
}

.rug.round {
  border-radius: 50%;
}

.rug-inner {
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  border: 2px dashed color-mix(in srgb, var(--b) 80%, #fff);
  background: repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in srgb, var(--b) 35%, transparent) 10px 20px);
  display: grid;
  place-items: center;
}

.rug-label {
  font-weight: 900;
  letter-spacing: 0.25em;
  font-size: 13px;
  color: color-mix(in srgb, var(--b) 60%, #fff);
}

.k-pet {
  transition: left 0.9s linear, top 0.9s linear;
}

.k-pet .obj-emoji {
  transition: transform 0.2s;
}

.k-pet.flip .obj-emoji {
  transform: scaleX(-1);
}

.k-pet.walking .obj-emoji {
  animation: hop 0.3s ease-in-out 3;
}

@keyframes hop {
  50% {
    translate: 0 -5px;
  }
}

/* Players */

.player {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  will-change: transform;
  cursor: pointer;
}

.av-shadow {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 30px;
  height: 9px;
  margin-left: -15px;
  border-radius: 50%;
  background: rgba(20, 22, 40, 0.28);
  filter: blur(0.5px);
}

.av-ring {
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 42px;
  height: 16px;
  margin-left: -21px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.player.me .av-ring {
  border-color: color-mix(in srgb, var(--ring) 70%, transparent);
}

.player.speaking .av-ring {
  border-color: var(--good);
  box-shadow: 0 0 10px var(--good), inset 0 0 6px var(--good);
  animation: ringPulse 0.9s ease-in-out infinite;
}

@keyframes ringPulse {
  50% {
    transform: scale(1.12);
  }
}

.player.located .av-ring {
  border-color: #ffd84d;
  animation: locatePulse 0.8s ease-in-out infinite;
}

@keyframes locatePulse {
  50% {
    transform: scale(1.6);
    box-shadow: 0 0 20px #ffd84d;
  }
}

.av-bob {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  transition: bottom 0.2s ease;
}

.av-body {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  animation: breathe 2.6s ease-in-out infinite;
}

.av-flip {
  position: absolute;
  inset: 0;
  transition: transform 0.12s;
}

.face-left .av-flip {
  transform: scaleX(-1);
}

.av-face {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 1.5px rgba(20, 22, 40, 0.22));
}

.av-hat {
  position: absolute;
  left: 50%;
  top: -15px;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  pointer-events: none;
}

.av-item {
  position: absolute;
  right: -12px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  animation: itemBob 1.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes itemBob {
  50% {
    transform: translateY(-2px) rotate(-6deg);
  }
}

.player.walking .av-body {
  animation: waddle 0.34s ease-in-out infinite;
}

.player.walking .av-shadow {
  animation: shadowBob 0.17s ease-in-out infinite alternate;
}

.player.sitting .av-bob {
  bottom: 1px;
}

.player.sitting .av-body {
  animation: sitBreathe 3s ease-in-out infinite;
}

.player.away .av-face {
  filter: grayscale(0.55) opacity(0.8) drop-shadow(0 2px 1.5px rgba(20, 22, 40, 0.22));
}

.player.dnd .av-ring {
  border-color: rgba(255, 92, 122, 0.55);
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.02, 1.035) translateY(-0.5px);
  }
}

@keyframes sitBreathe {
  0%,
  100% {
    transform: scale(1.05, 0.95);
  }
  50% {
    transform: scale(1.04, 0.97);
  }
}

@keyframes waddle {
  0% {
    transform: translateY(0) rotate(-7deg) scale(1.05, 0.95);
  }
  25% {
    transform: translateY(-7px) rotate(0deg) scale(0.96, 1.06);
  }
  50% {
    transform: translateY(0) rotate(7deg) scale(1.05, 0.95);
  }
  75% {
    transform: translateY(-7px) rotate(0deg) scale(0.96, 1.06);
  }
  100% {
    transform: translateY(0) rotate(-7deg) scale(1.05, 0.95);
  }
}

@keyframes shadowBob {
  to {
    transform: scale(0.75);
    opacity: 0.7;
  }
}

/* Overlay: name tags, bubbles, emotes */

.world-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.nametag {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 6px;
  border-radius: 6px;
  background: rgba(14, 15, 19, 0.8);
  color: #fff;
  font: 600 11.5px/1.2 var(--font);
  letter-spacing: -0.005em;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 2px 6px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  transition: box-shadow 0.15s;
}

.nametag.me {
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--tag, var(--accent)) 75%, transparent), 0 2px 6px rgba(0, 0, 0, 0.28);
}

.nametag.talking {
  box-shadow: 0 0 0 1.5px var(--good), 0 0 10px rgba(62, 207, 142, 0.55);
}

.nt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.14);
}

.nt-status {
  width: 14px;
  height: 14px;
}

.nt-icon {
  width: 14px;
  height: 14px;
}

i.nt-icon {
  width: 13px;
  height: auto;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.82);
}

.nt-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.nt-icons:empty {
  display: none;
}

.chat-bubble {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 230px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff;
  color: #17181d;
  font: 500 12.5px/1.4 var(--font), var(--emoji);
  box-shadow: 0 0 0 1px rgba(15, 17, 26, 0.08), 0 6px 16px rgba(0, 0, 0, 0.22);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  animation: popIn 0.22s var(--ease);
  transition: opacity 0.3s;
}

.chat-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-bottom: 0;
  border-top-color: #fff;
}

.leaving {
  opacity: 0 !important;
}

@keyframes popIn {
  from {
    opacity: 0;
    scale: 0.7;
  }
}

.emote-wrap {
  position: absolute;
  left: 0;
  top: 0;
}

.emote-float {
  width: 46px;
  height: 46px;
  display: block;
  animation: emoteRise 2.4s ease-out forwards;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}

@keyframes emoteRise {
  0% {
    transform: translateY(20px) scale(0.3);
    opacity: 0;
  }
  15% {
    transform: translateY(0) scale(1.15);
    opacity: 1;
  }
  25% {
    transform: translateY(0) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(-34px) scale(0.9);
    opacity: 0;
  }
}

.obj-fx {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  padding: 7px 12px;
  border-radius: 14px;
  background: rgba(22, 24, 38, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  animation: popIn 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
  transition: opacity 0.3s;
}

.obj-float {
  position: absolute;
  width: 32px;
  height: 32px;
  animation: objRise 1.6s ease-out forwards;
  z-index: 10;
}

@keyframes objRise {
  0% {
    transform: translateY(10px) scale(0.4);
    opacity: 0;
  }
  20% {
    transform: translateY(0) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateY(-46px) scale(0.9);
    opacity: 0;
  }
}

.trail-particle {
  position: absolute;
  width: 16px;
  height: 16px;
  animation: trailFade 1.1s ease-out forwards;
}

@keyframes trailFade {
  0% {
    transform: scale(0.4) rotate(0);
    opacity: 0.95;
  }
  100% {
    transform: translateY(-14px) scale(1.1) rotate(40deg);
    opacity: 0;
  }
}

.poof-particle {
  position: absolute;
  width: 24px;
  height: 24px;
  animation: poof 0.8s ease-out forwards;
  z-index: 5;
}

@keyframes poof {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(1.2);
    opacity: 0;
  }
}

.interact-hint {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 500;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: hintIn 0.22s var(--ease);
  z-index: 15;
}

.interact-hint kbd {
  min-width: 24px;
  height: 24px;
  background: #ffd84d;
  color: #3a2c00;
  border-color: #d9b42a;
  font-size: 12px;
}

@keyframes hintIn {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
}

.locate-arrow {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 18;
  pointer-events: none;
}

.locate-arrow::before {
  content: '';
  position: absolute;
  left: -14px;
  top: -12px;
  border: 12px solid transparent;
  border-left: 22px solid #ffd84d;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  animation: nudge 0.8s ease-in-out infinite;
}

@keyframes nudge {
  50% {
    transform: translateX(6px);
  }
}

/* HUD */

.hud-top {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 20;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hud-center {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 420px);
}

.hud-center > * {
  pointer-events: auto;
}

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 8px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font: 500 13.5px var(--font);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  max-width: 46vw;
  transition: border-color 0.15s, background 0.15s;
}

.room-chip:hover {
  border-color: var(--line-3);
}

.room-chip > img,
.room-chip .room-logo {
  flex: none;
}

.room-chip .room-logo {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #fff;
  font-size: 11px;
  background: linear-gradient(140deg, #8794ff, #6b5cff 55%, #a46bff);
}

.room-chip b {
  font-weight: 600;
}

.room-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-chip .sep {
  color: var(--faint);
}

.room-chip .caret {
  color: var(--muted);
  font-size: 10px;
}

.ping {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ping.good::before,
.ping.ok::before,
.ping.bad::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--good);
}

.ping.ok::before {
  background: var(--warn);
}

.ping.bad::before {
  background: var(--bad);
}

.ping:empty {
  display: none;
}

.zone-chip,
.follow-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--zc, var(--accent)) 55%, transparent);
  animation: hintIn2 0.22s var(--ease);
  white-space: nowrap;
}

.zone-chip > i,
.follow-chip > i {
  color: var(--zc, var(--accent-text));
}

.zone-chip b {
  font-weight: 600;
}

.zone-chip span {
  color: var(--muted);
}

.follow-chip .btn {
  margin-right: -6px;
}

.zone-chip.z-spotlight {
  border-color: #ffd23f;
  background: linear-gradient(90deg, rgba(255, 210, 63, 0.22), var(--glass));
}

@keyframes hintIn2 {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.reconnecting {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--warn);
  color: #2e1f00;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow);
}

/* Video strip */

.video-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 2px;
}

.video-strip.empty {
  display: none;
}

.vtile {
  position: relative;
  flex: none;
  width: 136px;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 20%, color-mix(in srgb, var(--ring) 38%, #2a2c35), color-mix(in srgb, var(--ring) 18%, #121318));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), var(--shadow-sm);
  transition: box-shadow 0.15s, opacity 0.2s, transform 0.2s;
  animation: popIn 0.25s ease;
}

.vtile.speaking {
  box-shadow: 0 0 0 2px var(--good), 0 0 0 5px rgba(62, 207, 142, 0.22), var(--shadow-sm);
}

.vtile.faded {
  opacity: 0.6;
}

.vtile.screen {
  width: 164px;
  cursor: zoom-in;
  background: #0b0c10;
}

.vt-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.vt-face {
  display: grid;
  place-items: center;
}

.vt-face .av-thumb {
  border-radius: 50%;
  background: color-mix(in srgb, var(--ring) 30%, rgba(255, 255, 255, 0.1));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.vt-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  background: #000;
}

.vtile.screen video {
  object-fit: contain;
}

.vtile.has-video video {
  display: block;
}

.vtile.has-video .vt-face {
  display: none;
}

.vtile.mirror video {
  transform: scaleX(-1);
}

.vt-label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.vt-name {
  min-width: 0;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(10, 11, 15, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font: 500 11px/20px var(--font);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vt-mic,
.vt-kind {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 10px;
  color: #fff;
}

.vt-mic {
  background: var(--bad);
}

.vt-kind {
  background: rgba(10, 11, 15, 0.62);
}

.vt-zoom {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(10, 11, 15, 0.62);
  color: #fff;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}

.vtile.screen .vt-zoom {
  display: grid;
}

.vtile.screen:hover .vt-zoom {
  opacity: 1;
}

.vt-more {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 92px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  font-weight: 600;
  color: var(--text-2);
}

.screen-wrap {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  height: 70vh;
}

.screen-full {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Dock */

.dock {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow), inset 0 1px 0 color-mix(in srgb, #fff 4%, transparent);
  transition: left 0.3s var(--ease);
  max-width: calc(100vw - 16px);
}

.dock-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dock-sep {
  width: 1px;
  height: 24px;
  background: var(--line-2);
  margin: 0 5px;
  flex: none;
}

.dock-me {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 10px 0 5px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  min-width: 0;
  max-width: 230px;
  transition: background 0.15s;
}

.dock-me:hover {
  background: var(--panel-3);
}

.dock-avatar-wrap {
  position: relative;
  flex: none;
}

.dock-avatar {
  display: block;
  width: 32px;
  height: 32px;
}

.dock-avatar .av-thumb {
  border-radius: 9px;
}

.dock-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--panel);
}

.dock-me-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.dock-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}

.dock-status span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-caret {
  color: var(--faint);
  font-size: 9px;
  margin-left: 2px;
}

.dock-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex: none;
}

.dock-btn:hover {
  background: var(--panel-3);
  color: var(--text);
}

.dock-btn:active {
  transform: scale(0.94);
}

.dock-btn.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.dock-ic {
  pointer-events: none;
}

img.dock-ic {
  width: 22px;
  height: 22px;
}

.dock-btn.off {
  background: var(--bad-soft);
  color: var(--bad);
}

.dock-btn.off:hover {
  background: color-mix(in srgb, var(--bad) 22%, transparent);
}

.dock-btn.live {
  background: var(--good-soft);
  color: var(--good);
}

.dock-btn.ptt::after {
  content: '';
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
}

.mic-level {
  position: absolute;
  right: 6px;
  bottom: 9px;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--good);
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 0.06s linear;
}

.dock-btn.off .mic-level {
  display: none;
}

.dock-btn[data-tip]:hover::before,
.dock:not(:hover) .dock-btn[data-tip]:focus-visible::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--tip-bg);
  color: #fff;
  font: 500 12px/1.3 var(--font);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 2;
  animation: tipIn 0.12s var(--ease) 0.2s both;
}

@keyframes tipIn {
  from {
    opacity: 0;
    transform: translate(-50%, 3px);
  }
}

.dock-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--badge);
  color: #fff;
  font: 600 10px/16px var(--font);
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--panel);
}

.dock-badge.neutral {
  background: var(--panel-3);
  color: var(--text-2);
}

/* Minimap and zoom */

.minimap {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 22;
  padding: 8px;
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  transition: right 0.3s var(--ease);
}

.minimap-title {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 52px 6px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.minimap-canvas {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.minimap-canvas canvas {
  display: block;
  max-width: 200px;
  max-height: 200px;
  image-rendering: pixelated;
}

.mm-dots {
  position: absolute;
  left: 0;
  top: 0;
  cursor: crosshair;
}

.minimap-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: var(--panel-3);
  color: var(--text-2);
  border-radius: 6px;
  padding: 0 8px;
  height: 22px;
  font: 500 11.5px var(--font);
  cursor: pointer;
}

.minimap-toggle:hover {
  color: var(--text);
}

.minimap.collapsed {
  padding: 0;
}

.minimap.collapsed .minimap-title,
.minimap.collapsed .minimap-canvas {
  display: none;
}

.minimap.collapsed .minimap-toggle {
  position: static;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: transparent;
}

.zoom-ctl {
  position: fixed;
  right: 14px;
  bottom: 250px;
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  transition: right 0.3s var(--ease);
}

.minimap.collapsed + .zoom-ctl {
  bottom: 64px;
}

.zoom-ctl button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: 500 17px var(--font);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.zoom-ctl button i {
  font-size: 13px;
}

.zoom-ctl button:hover {
  background: var(--panel-3);
  color: var(--text);
}

body.side-open .minimap,
body.side-open .zoom-ctl {
  right: calc(var(--side-w) + 14px);
}

body.side-open .dock {
  left: calc(50% - var(--side-w) / 2);
}

body.side-open .toasts {
  right: calc(var(--side-w) + 14px);
}

/* Toasts and banner */

.toasts {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  transition: right 0.3s var(--ease);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 10px 11px 13px;
  border-radius: 12px;
  background: var(--elev);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: toastIn 0.28s var(--ease);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.leaving {
  transform: translateX(16px);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

.toast-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 0;
  font-size: 15px;
  color: var(--accent-text);
}

img.toast-icon {
  width: 22px;
  height: 22px;
}

.toast.success .toast-icon {
  color: var(--good);
}

.toast.warn .toast-icon {
  color: var(--warn);
}

.toast.error .toast-icon {
  color: var(--bad);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-text {
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.45;
  padding-top: 1px;
  overflow-wrap: anywhere;
}

.toast-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.toast-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--faint);
  font-size: 12px;
  cursor: pointer;
}

.toast-x:hover {
  background: var(--panel-3);
  color: var(--text);
}

.banner {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(560px, calc(100vw - 24px));
  padding: 12px 12px 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5d6bff, #7f5cff 60%, #9b5cf5);
  color: #fff;
  box-shadow: 0 16px 40px rgba(93, 92, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: bannerIn 0.4s var(--ease);
  transition: opacity 0.4s;
}

.banner .toast-x {
  color: rgba(255, 255, 255, 0.75);
}

.banner .toast-x:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.banner-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 15px;
}

img.banner-icon {
  padding: 4px;
}

.banner > div {
  flex: 1;
  min-width: 0;
}

.banner-by {
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.8;
}

.banner-text {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.4;
  white-space: pre-wrap;
}

@keyframes bannerIn {
  from {
    opacity: 0;
    transform: translate(-50%, -14px) scale(0.97);
  }
}

/* Sidebar */

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--side-w);
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  transform: translateX(105%);
  transition: transform 0.3s var(--ease);
}

.sidebar.open {
  transform: none;
}

.side-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.side-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px;
}

.side-icon img {
  width: 18px;
  height: 18px;
}

.side-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.side-x,
.modal-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.side-x:hover,
.modal-x:hover {
  background: var(--panel-3);
  color: var(--text);
}

.side-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
}

.side-body > * {
  flex: 1;
  min-height: 0;
}

/* Chat */

.chat-panel {
  display: flex;
  flex-direction: column;
  padding: 0 12px 12px;
  gap: 8px;
}

.chat-hint {
  font-size: 12px;
  color: var(--muted);
  padding: 0 2px;
}

.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
  margin: 0 -4px;
  display: flex;
  flex-direction: column;
}

.msg {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  padding: 3px 8px;
  border-radius: 8px;
}

.msg:hover {
  background: var(--panel-2);
}

.msg:not(.grouped) {
  margin-top: 10px;
  padding-top: 5px;
}

.msg-avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  grid-row: span 2;
  flex: none;
}

img.msg-avatar {
  object-fit: contain;
}

.msg.grouped .msg-text {
  grid-column: 2;
}

.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.msg-name {
  font-weight: 600;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-time {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.msg-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-text a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-text) 40%, transparent);
}

.chat-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: auto 0;
}

.chat-empty p {
  margin: 0;
  max-width: 240px;
}

.chat-empty.small {
  padding: 20px 14px;
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}

:root[data-theme='light'] .chat-composer {
  background: var(--panel);
}

.chat-composer:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.chat-composer .chat-input {
  border: 0;
  background: transparent !important;
  box-shadow: none !important;
  resize: none;
  min-height: 34px;
  padding: 7px 4px;
  max-height: 140px;
}

.chat-composer .icon-btn {
  width: 34px;
  height: 34px;
}

.chat-composer .icon-btn.send {
  color: var(--faint);
}

.chat-composer .icon-btn.send.ready {
  background: var(--accent);
  color: #fff;
}

.chat-clear {
  align-self: flex-end;
  flex: none !important;
}

.dm-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-new {
  margin-bottom: 8px;
  flex: none;
}

.dm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
}

.dm-item:hover {
  background: var(--panel-2);
}

.dm-item .msg-avatar {
  width: 36px;
  height: 36px;
}

.dm-item.unread .dm-name {
  color: var(--text);
}

.dm-item.unread .dm-last {
  color: var(--text-2);
}

.dm-meta {
  flex: 1;
  min-width: 0;
}

.dm-name {
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.dm-time {
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
}

.dm-last {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none !important;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.dm-head .msg-avatar {
  width: 26px;
  height: 26px;
}

.dm-head b {
  font-weight: 600;
}

.dm-online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.dm-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--offline);
}

.dm-online.on::before {
  background: var(--good);
}

.chat-panel > .seg,
.chat-panel > .chat-hint,
.chat-panel > .chat-composer {
  flex: none;
}

/* People */

.people-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}

.people-panel > .input,
.people-panel > .search-field {
  flex: none;
}

.people-list {
  overflow-y: auto;
  flex: 1;
  margin: 0 -4px;
  padding: 0 4px;
}

.people-section {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 8px 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.people-count {
  padding: 0 6px;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 17px;
  font-variant-numeric: tabular-nums;
}

.person {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: background 0.12s;
}

.person:hover,
.person:focus-visible {
  background: var(--panel-2);
}

.person:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.person.offline .person-av,
.person.offline .person-meta {
  opacity: 0.55;
}

.person-av {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
}

.person-av img {
  width: 36px;
  height: 36px;
  display: block;
}

.person-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--panel);
}

.person:hover .person-dot {
  border-color: var(--panel-2);
}

.person-meta {
  flex: 1;
  min-width: 0;
}

.person-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.3;
}

.person-name .you,
.person-name .role {
  font-size: 10.5px;
  font-weight: 500;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--panel-3);
  color: var(--muted);
  line-height: 16px;
  text-transform: capitalize;
}

.person-name .role {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.person-sub,
.person-where {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.person-where {
  color: var(--faint);
}

.person-where i {
  font-size: 9.5px;
  width: 11px;
}

.person-place {
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-time {
  flex: none;
  padding-left: 6px;
  border-left: 1px solid var(--line-2);
}

.person-actions {
  display: flex;
  gap: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.person:hover .person-actions,
.person:focus-within .person-actions {
  opacity: 1;
}

@media (hover: none) {
  .person-actions {
    opacity: 1;
  }
}

/* Build panel */

.build-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
  overflow: hidden;
}

.build-panel > * {
  flex: none;
}

.bp-help {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  padding: 0 2px;
}

.bp-cats {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.bp-cat {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font: 600 12px var(--font);
  cursor: pointer;
  white-space: nowrap;
}

.bp-cat.active {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-2));
}

.bp-grid {
  flex: 1 !important;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-content: start;
}

.bp-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--panel-2);
  cursor: pointer;
  color: var(--text);
  font-family: var(--font);
  transition: transform 0.12s, border-color 0.15s;
}

.bp-item:hover {
  transform: translateY(-2px);
}

.bp-item.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
}

.bp-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 10px;
  background: repeating-conic-gradient(rgba(127, 127, 127, 0.07) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px;
  pointer-events: none;
}

.bp-thumb-inner {
  position: absolute;
  left: 50%;
  top: 56%;
  transform-origin: center;
}

.bp-name {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.bp-badge {
  position: absolute;
  top: 4px;
  right: 4px;
}

.bp-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bp-variants:empty,
.bp-info[hidden] {
  display: none;
}

.bp-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}

.tool-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.tool-seg .seg-btn {
  flex-direction: column;
  gap: 4px;
  min-height: 46px;
  padding: 6px 2px;
  font-size: 11.5px;
}

.tool-seg .seg-btn i {
  font-size: 13px;
}

/* Map maker */

.map-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
  overflow: hidden;
}

.map-panel > .seg {
  flex: none;
}

.mm-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mm-help {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
}

.mm-hint {
  color: var(--muted);
  font-weight: 600;
}

.mm-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.mm-row .field {
  flex: 1;
  margin-bottom: 0;
}

.mm-swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mm-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--panel-2);
  cursor: pointer;
  color: var(--text);
  font: 500 10px var(--font);
}

.mm-swatch.active {
  border-color: var(--accent);
}

.mm-swatch-canvas,
.mm-void {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.mm-void {
  background: #2c2f3d;
  border: 2px dashed var(--line-2);
}

.mm-zones {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mm-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--panel-2);
  cursor: pointer;
  color: var(--text);
  font: 500 13px var(--font);
  text-align: left;
}

.mm-zone.active {
  border-color: var(--zc, var(--accent));
}

.mm-zone-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--zc);
  flex: none;
}

.mm-zone-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mm-zone-meta small {
  color: var(--muted);
}

.mm-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--panel-2);
}

.mm-section h4 {
  font-size: 14px;
}

.mm-room {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.mm-room span {
  flex: 1;
}

.mm-room small {
  color: var(--muted);
}

.mm-room.current span {
  color: var(--accent);
}

.mm-portal {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.mm-count {
  font-weight: 600;
}

.mm-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mm-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.mm-mark {
  position: absolute;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  background: rgba(124, 140, 255, 0.25);
}

.mm-mark.portal {
  background: rgba(181, 140, 255, 0.35);
}

.mm-mark.portal span {
  font: 600 9px var(--font);
  color: #fff;
  text-shadow: 0 1px 2px #000;
  text-align: center;
}

.mm-rect {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(124, 140, 255, 0.18);
  border-radius: 4px;
}

.mm-coord {
  position: fixed;
  left: 14px;
  bottom: 84px;
  z-index: 22;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--glass);
  font: 600 12px var(--font);
  color: var(--muted);
}

.world.mapping {
  cursor: crosshair;
}

/* Popovers, menus, cards */

.popover {
  position: fixed;
  z-index: 220;
  min-width: 200px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  border-radius: 12px;
  background: var(--elev);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition: opacity 0.14s, transform 0.14s var(--ease);
}

.popover.open {
  opacity: 1;
  transform: none;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.menu-label {
  padding: 6px 10px 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 500 13.5px/1.3 var(--font);
  cursor: pointer;
  text-align: left;
}

.menu-item > i,
.menu-item > img {
  flex: none;
  color: var(--muted);
  font-size: 13px;
}

.menu-item > img {
  width: 18px;
  height: 18px;
}

.menu-item span {
  flex: 1;
  min-width: 0;
}

.menu-item kbd {
  font-size: 10.5px;
  min-width: 18px;
  height: 18px;
  color: var(--muted);
}

.menu-item:hover {
  background: var(--panel-3);
}

.menu-item:hover > i {
  color: var(--text);
}

.menu-item.active,
.menu-item.active > i {
  color: var(--accent-text);
}

.menu-item.danger,
.menu-item.danger > i {
  color: var(--bad);
}

.menu-item.danger:hover {
  background: var(--bad-soft);
}

.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 5px 4px;
}

.status-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 4px 6px;
}

.status-emoji {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.status-emoji:hover {
  border-color: var(--line-3);
}

.status-emoji .dim {
  opacity: 0.45;
}

.avail-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.avail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 400 13.5px var(--font);
  cursor: pointer;
  text-align: left;
}

.avail-item > span:nth-child(2) {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.avail-item b {
  font-weight: 500;
}

.avail-item small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.avail-item:hover {
  background: var(--panel-3);
}

.avail-item.active {
  background: var(--panel-2);
}

.avail-check {
  color: var(--accent-text);
  font-size: 12px;
}

.avail-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.emote-pop .menu-label {
  padding-top: 2px;
}

.emote-bar {
  display: grid;
  grid-template-columns: repeat(6, 48px);
  gap: 2px;
  padding: 2px;
}

.emote-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s;
}

.emote-btn:hover {
  background: var(--panel-3);
  transform: translateY(-2px);
}

.emote-btn:active {
  transform: scale(0.94);
}

.emote-art {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  object-fit: contain;
}

.emote-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  padding: 0 2px;
}

.emote-ic {
  font-size: 19px;
}

.emote-btn kbd {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 4px;
  border-bottom-width: 1px;
  font-size: 9px;
  color: var(--muted);
}

.emote-btn.active {
  background: var(--warn-soft);
  color: var(--warn);
}

.player-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px;
}

.pc-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pc-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--ring, var(--accent)) 40%, var(--panel-2)), color-mix(in srgb, var(--ring, var(--accent)) 16%, var(--panel-2)));
  box-shadow: inset 0 0 0 1px var(--line);
}

.pc-avatar .av-thumb {
  background: none;
  box-shadow: none;
}

.pc-hat {
  position: absolute;
  top: -14px;
  left: 50%;
  margin-left: -17px;
}

.pc-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.pc-name {
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.015em;
}

.pc-title {
  color: var(--muted);
  font-size: 13px;
}

.pc-avail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
}

.pc-role {
  margin-top: 4px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.pc-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 13px;
}

.pc-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
}

.pc-facts:empty {
  display: none;
}

.pc-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.pc-vol-icon {
  flex: none;
  width: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.pc-vol-range {
  flex: 1;
  min-width: 0;
}

.pc-vol-value {
  flex: none;
  min-width: 40px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pc-facts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pc-facts i {
  font-size: 10.5px;
  color: var(--faint);
}

.pc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.card-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font: 500 13px/1.25 var(--font);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.card-btn > i,
.card-btn > img {
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
}

.card-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-btn:hover {
  background: var(--panel-3);
  border-color: var(--line-3);
}

.card-btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.card-btn.primary > i {
  color: rgba(255, 255, 255, 0.85);
}

.card-btn.primary:hover {
  background: var(--accent-hover);
}

.card-btn.danger,
.card-btn.danger > i {
  color: var(--bad);
}

.card-btn.danger:hover {
  background: var(--bad-soft);
}

/* Modals */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 7, 10, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.18s;
}

:root[data-theme='light'] .modal-backdrop {
  background: rgba(22, 24, 34, 0.32);
}

.modal-backdrop.open {
  opacity: 1;
}

.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.22s var(--ease);
}

.modal-backdrop.open .modal {
  transform: none;
}

.modal.sm {
  width: min(420px, 100%);
}

.modal.lg {
  width: min(880px, 100%);
}

.modal.xl {
  width: min(1180px, 100%);
}

.modal.full {
  width: min(96vw, 1600px);
}

.modal-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 12px 20px;
}

.modal > .modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.modal-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 14px;
}

.modal-icon img,
img.modal-icon {
  width: 22px;
  height: 22px;
}

.modal-danger .modal-icon {
  background: var(--bad-soft);
  color: var(--bad);
}

.modal-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body {
  padding: 4px 20px 20px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.modal-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 55%, transparent);
  border-radius: 0 0 16px 16px;
}

.confirm-text {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.modal.sm:has(.modal-head .modal-icon) .modal-body {
  padding-left: 64px;
}

.modal.sm .modal-body .field {
  margin-bottom: 0;
}

.game-host {
  min-height: 360px;
  height: min(68vh, 640px);
  display: flex;
  flex-direction: column;
}

.wb-host {
  height: min(74vh, 760px);
}

.embed-wrap {
  position: relative;
  height: min(72vh, 760px);
  border-radius: 14px;
  overflow: hidden;
  background: #0f1220;
}

.embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
  background: #fff;
}

.embed-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9aa1b9;
  font-weight: 500;
  padding: 20px;
  text-align: center;
}

.note-paper {
  padding: 22px;
  border-radius: 12px;
  background: linear-gradient(#fff9c9, #fff3a3);
  color: #3d3520;
  font-weight: 500;
  line-height: 1.6;
  white-space: pre-wrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transform: rotate(-0.6deg);
}

.desk-free,
.desk-owner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.desk-free p {
  margin: 0;
  font-weight: 600;
}

.desk-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.desk-note {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--panel-2);
}

.desk-note-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.desk-note-head small {
  color: var(--muted);
}

.desk-note-text {
  white-space: pre-wrap;
  font-weight: 600;
}

.board-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.board-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.board-compose .dev-row {
  justify-content: space-between;
}

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #d8a86c;
  background-image: radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px);
  background-size: 6px 6px;
  min-height: 180px;
  max-height: 52vh;
  overflow-y: auto;
}

.posts .chat-empty {
  grid-column: 1 / -1;
  color: #5a3d1c;
}

.post {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px 10px;
  min-height: 120px;
  border-radius: 4px;
  color: #2d2a20;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  transform: rotate(-1deg);
  animation: popIn 0.25s ease;
}

.post:nth-child(even) {
  transform: rotate(1.2deg);
}

.post::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff9a9a, #d43d3d);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

.post.c0 {
  background: #fff3a3;
}
.post.c1 {
  background: #ffd1dc;
}
.post.c2 {
  background: #c9f2d9;
}
.post.c3 {
  background: #cfe3ff;
}
.post.c4 {
  background: #e6d4ff;
}
.post.c5 {
  background: #ffe0b8;
}

.post-text {
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.post-foot {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}

.post-del {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: inherit;
}

.stations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.station {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--panel-2);
  color: var(--text);
  font: 600 14px var(--font);
  cursor: pointer;
  text-align: left;
}

.station:hover {
  background: var(--panel-3);
}

.station.active {
  border-color: var(--accent);
}

.clock-modal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tz-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--panel-2);
}

.tz-meta {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.tz-meta b {
  font-size: 20px;
}

.tz-meta small {
  color: var(--muted);
  font-weight: 500;
}

.tz-people {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.tz-people img {
  width: 26px;
  height: 26px;
}

.tz-people img.off {
  opacity: 0.4;
  filter: grayscale(0.7);
}

.scores {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scores li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  font-weight: 500;
}

.scores .rank {
  width: 28px;
  font-family: var(--emoji), var(--font);
}

.score-name {
  flex: 1;
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.temp-pw {
  display: block;
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--panel-2);
  font: 600 20px ui-monospace, monospace;
  letter-spacing: 0.06em;
  text-align: center;
  user-select: all;
}

/* Settings */

.settings-modal .modal-body {
  padding: 0;
  display: flex;
}

.settings {
  flex: 1;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  height: min(72vh, 640px);
  border-top: 1px solid var(--line);
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 45%, transparent);
  border-radius: 0 0 0 16px;
}

.settings-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: 500 13.5px var(--font);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.settings-nav-btn i {
  color: var(--muted);
  font-size: 13px;
}

.settings-nav-btn:hover {
  color: var(--text);
  background: var(--panel-3);
}

.settings-nav-btn.active {
  color: var(--text);
  background: var(--panel-3);
}

.settings-nav-btn.active i {
  color: var(--accent-text);
}

.settings-pane {
  min-width: 0;
  min-height: 0;
  padding: 20px 24px 24px;
  overflow-y: auto;
}

.settings-tab {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-tab h4,
.settings-section h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.settings-group {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
  margin: 0 0 6px;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 10px 14px;
  cursor: pointer;
}

.settings-tab > .setting {
  padding: 10px 2px;
}

.settings-group .setting + .setting,
.settings-group > * + .setting {
  border-top: 1px solid var(--line);
}

.setting-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.setting-text b {
  font-weight: 500;
  font-size: 13.5px;
}

.setting-text small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.setting .seg {
  flex: none;
}

.setting .range {
  max-width: 220px;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(260px, 55%);
}

.range-value {
  flex: none;
  width: 38px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.settings-cam {
  width: 240px;
  max-width: 100%;
  border-radius: 10px;
  transform: scaleX(-1);
  margin-bottom: 10px;
  border: 1px solid var(--line);
}

.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
  margin-bottom: 18px;
}

.account-card > img {
  flex: none;
}

.account-meta {
  flex: 1;
  min-width: 0;
}

.account-meta b {
  font-weight: 600;
  font-size: 14.5px;
}

.account-meta .muted {
  font-size: 12.5px;
}

.admin-users {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.admin-users > p {
  margin: 0;
  padding: 12px 14px;
}

.admin-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 14px;
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
}

.admin-user + .admin-user {
  border-top: 1px solid var(--line);
}

.admin-user-meta {
  min-width: 0;
}

.admin-user-meta b {
  font-weight: 500;
}

.admin-user .muted.small {
  display: flex;
  align-items: center;
  gap: 6px;
}

.presence {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--offline);
}

.presence.on {
  background: var(--good);
}

.shortcuts {
  display: flex;
  flex-direction: column;
}

.shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  font-size: 13.5px;
}

.shortcut + .shortcut {
  border-top: 1px solid var(--line);
}

.keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.key-or {
  color: var(--faint);
  font-size: 11px;
}

.about-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.about-hero h3 {
  font-size: 17px;
}

.about-hero p {
  margin: 2px 0 0;
}

.credits {
  margin-bottom: 14px;
}

.credit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-2);
}

.credit + .credit {
  border-top: 1px solid var(--line);
}

.credit > i {
  color: var(--muted);
}

.about > p {
  font-size: 13px;
}

/* Small screens */

@media (max-width: 900px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .avatar-editor {
    grid-template-columns: 1fr;
  }

  .hud-center {
    max-width: calc(100vw - 24px);
    top: 52px;
  }

  .settings {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: min(76vh, 640px);
  }

  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 8px;
  }

  .settings-nav-btn {
    flex: none;
  }

  .settings-nav-btn span {
    display: none;
  }

  .settings-pane {
    padding: 16px;
  }
}

@media (max-width: 700px) {
  :root {
    --side-w: 100vw;
  }

  body.side-open .dock,
  body.side-open .minimap,
  body.side-open .zoom-ctl {
    display: none;
  }

  body.side-open .toasts {
    right: 14px;
  }

  .dock {
    bottom: max(8px, env(safe-area-inset-bottom));
    gap: 0;
    padding: 4px;
    border-radius: 14px;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .dock::-webkit-scrollbar {
    display: none;
  }

  .dock-group {
    gap: 0;
  }

  .dock-me-text,
  .dock-caret,
  .dock .desk-only {
    display: none;
  }

  .dock > *,
  .dock-group > * {
    flex-shrink: 0;
  }

  .dock-sep {
    margin: 0 3px;
  }

  .dock-me {
    height: 40px;
    padding: 0 4px;
  }

  .dock-btn {
    width: 38px;
    height: 40px;
    font-size: 15px;
  }

  .dock-btn[data-tip]:hover::before {
    display: none;
  }

  .minimap {
    display: none;
  }

  .zoom-ctl {
    bottom: 76px;
    right: 10px;
  }

  .minimap.collapsed + .zoom-ctl {
    bottom: 76px;
  }

  .vtile {
    width: 92px;
    height: 68px;
  }

  .vt-face .av-thumb {
    transform: scale(0.8);
  }

  .vtile.screen {
    width: 112px;
  }

  .interact-hint {
    bottom: 76px;
  }

  .room-chip {
    max-width: 70vw;
  }

  .ping {
    display: none;
  }

  .zone-chip span {
    display: none;
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .lobby-card {
    padding: 18px;
    border-radius: 16px;
  }

  .lobby-head {
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  .pv-stage {
    width: 100%;
  }

  .ae-row {
    grid-template-columns: 1fr;
  }

  .modal {
    border-radius: 14px;
  }

  .modal-foot {
    border-radius: 0 0 14px 14px;
  }

  .modal-body {
    padding: 4px 16px 16px;
  }

  .modal.sm:has(.modal-head .modal-icon) .modal-body {
    padding-left: 16px;
  }

  .setting.slider,
  .setting:has(> .seg) {
    flex-wrap: wrap;
  }

  .range-wrap {
    width: 100%;
  }

  .admin-user {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .admin-user > .dd,
  .admin-user > .tag {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .mm-coord {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player.walking .av-body,
  .av-body,
  .glow,
  .live-dot {
    animation-duration: 0s !important;
    animation: none !important;
  }

  .login-card,
  .lobby-card,
  .toast,
  .banner,
  .chat-bubble,
  .vtile {
    animation: none !important;
  }

  .sidebar,
  .modal,
  .popover {
    transition-duration: 0.01s !important;
  }
}
