:root {
  --world-chat-bg: #050913;
  --world-chat-panel: rgba(8, 12, 25, .82);
  --world-chat-panel-strong: rgba(7, 10, 21, .94);
  --world-chat-line: rgba(164, 132, 255, .24);
  --world-chat-line-strong: rgba(174, 143, 255, .55);
  --world-chat-violet: #a586ff;
  --world-chat-violet-strong: #7451e8;
  --world-chat-text: #f5f0ff;
  --world-chat-muted: rgba(225, 220, 242, .68);
  --world-chat-soft: rgba(162, 147, 196, .5);
}

#groupExperience[hidden] { display: none; }

.world-chat-shell {
  position: relative;
  width: min(100%, 430px) !important;
  height: min(820px, calc(100dvh - 44px));
  min-height: 0 !important;
  margin: 0 auto;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 30px;
  background: var(--world-chat-bg);
  color: var(--world-chat-text);
  box-shadow: 0 18px 55px rgba(45, 38, 79, .18);
  isolation: isolate;
}

.world-chat-bg {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  filter: saturate(.7) brightness(.43) contrast(1.12) blur(.5px);
  transform: scale(1.02);
}

.world-chat-atmosphere {
  position: absolute;
  z-index: -2;
  inset: 0;
  background: rgba(2, 6, 14, .24);
  box-shadow: inset 0 104px 92px rgba(2, 6, 16, .66), inset 0 -180px 140px rgba(1, 4, 11, .78);
  pointer-events: none;
}

.world-chat-topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  margin: 0;
  padding: max(11px, env(safe-area-inset-top)) 16px 9px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(158, 125, 247, .16);
  background: rgba(4, 8, 18, .84);
  backdrop-filter: blur(16px);
}

.world-chat-back {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--world-chat-line);
  border-radius: 50%;
  background: rgba(15, 16, 34, .72);
  color: #e9e1ff;
  font-size: 18px;
}

.world-chat-topbar .brand { min-width: 0; display: block; }
.world-chat-topbar .brand h1 {
  overflow: hidden;
  margin: 1px 0 0;
  color: var(--world-chat-text);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .06em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.world-chat-topbar .brand p {
  margin: 0;
  color: #a88cff;
  font-size: 8px;
  letter-spacing: .2em;
}
.world-chat-topbar .mock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-color: var(--world-chat-line);
  background: rgba(24, 18, 50, .72);
  color: #c9b7ff;
  font-size: 9px;
}

.world-chat-login {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 24px;
  right: 24px;
  width: auto;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 28px 24px 26px;
  border: 1px solid var(--world-chat-line-strong);
  border-radius: 26px;
  background: rgba(7, 10, 22, .88);
  box-shadow: 0 0 34px rgba(116, 77, 224, .28), inset 0 0 28px rgba(135, 102, 231, .06);
  color: var(--world-chat-text);
  text-align: center;
  transform: translateY(-48%);
  backdrop-filter: blur(18px);
}
.world-chat-login .logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border: 1px solid #9f7df8;
  border-radius: 50%;
  background: rgba(74, 48, 145, .55);
  color: #dcd0ff;
  font-size: 25px;
  box-shadow: 0 0 22px rgba(127, 84, 239, .42);
}
.world-chat-kicker {
  display: block;
  color: #aa8cff;
  font-size: 8px;
  letter-spacing: .22em;
}
.world-chat-login h2 {
  margin: 7px 0 8px;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: .08em;
}
.world-chat-login p {
  margin: 0 auto;
  max-width: 260px;
  color: var(--world-chat-muted);
  font-size: 12px;
  line-height: 1.7;
}
.world-chat-login .primary {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #a98cff;
  border-radius: 999px;
  background: rgba(84, 53, 176, .82);
  box-shadow: 0 0 24px rgba(119, 78, 230, .34), inset 0 0 18px rgba(207, 190, 255, .1);
}

.world-chat-app {
  position: absolute;
  z-index: 4;
  inset: 72px 0 80px;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
}
.world-chat-app[hidden] { display: none; }
.world-chat-app .panel {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--world-chat-text);
}

.world-chat-app .rooms {
  grid-row: 1;
  padding: 11px 14px 10px;
  border-bottom: 1px solid rgba(154, 122, 242, .14);
  background: rgba(7, 10, 23, .76);
  backdrop-filter: blur(14px);
}
.world-chat-app .panel-title {
  margin: 0 0 8px;
  color: rgba(235, 229, 250, .82);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
}
.world-chat-app .rooms-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.world-chat-app .rooms-list::-webkit-scrollbar { display: none; }
.world-chat-app .room {
  min-width: 150px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(149, 122, 225, .22);
  border-radius: 14px;
  background: rgba(16, 18, 37, .68);
  color: var(--world-chat-text);
}
.world-chat-app .room.on,
.world-chat-app .room:hover {
  border-color: rgba(177, 145, 255, .7);
  background: rgba(73, 47, 145, .6);
  box-shadow: 0 0 18px rgba(109, 71, 215, .22);
}
.world-chat-app .room b { overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.world-chat-app .room span { margin-top: 3px; color: var(--world-chat-muted); font-size: 9px; }
.world-chat-app .rooms > .status { display: none; }
.world-chat-app .add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border: 1px solid var(--world-chat-line);
  border-radius: 999px;
  background: rgba(44, 30, 90, .7);
  color: #d8caff;
  font-size: 9px;
}

.world-chat-app .members {
  grid-row: 2;
  min-height: 0;
  padding: 8px 14px 7px;
  border-bottom: 1px solid rgba(154, 122, 242, .14);
  background: rgba(7, 10, 23, .58);
  backdrop-filter: blur(12px);
}
.world-chat-app .members .panel-title { margin-bottom: 6px; }
.member-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8fd6c0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 8px;
  letter-spacing: 0;
}
.world-chat-app #members { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.world-chat-app #members::-webkit-scrollbar { display: none; }
.world-chat-app .member {
  min-width: 86px;
  flex: 0 0 auto;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 11px;
}
.world-chat-app .member.selected { border-color: rgba(166, 132, 255, .38); background: rgba(74, 49, 147, .4); }
.world-chat-app .member.quiet { opacity: .46; }
.world-chat-app .member .avatar {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(178, 151, 255, .5);
  border-radius: 50%;
  background: rgba(77, 54, 145, .72);
  color: #efe9ff;
  font-size: 10px;
}
.world-chat-app .member b { max-width: 46px; overflow: hidden; color: #f0ebff; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.world-chat-app .member span { color: var(--world-chat-muted); font-size: 8px; }
.world-chat-app .members > .status { display: none; }

.world-chat-app .chat {
  grid-row: 3;
  display: flex;
  min-height: 0;
  overflow: hidden;
  background: rgba(4, 8, 17, .26);
}
.world-chat-app .room-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px 9px;
  border-bottom: 1px solid rgba(154, 122, 242, .12);
  background: rgba(5, 9, 19, .55);
}
.world-chat-app .room-head h2 {
  max-width: 190px;
  overflow: hidden;
  margin: 2px 0 2px;
  color: #f6f0ff;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.world-chat-app .room-head p { margin: 0; color: var(--world-chat-muted); font-size: 9px; }
.world-chat-app .context { max-width: 150px; justify-content: flex-end; margin: 0; }
.world-chat-app .context span {
  padding: 4px 7px;
  border: 1px solid rgba(155, 125, 235, .2);
  border-radius: 999px;
  background: rgba(22, 22, 43, .68);
  color: rgba(226, 217, 249, .7);
  font-size: 8px;
}
.world-chat-app .context span:last-child { display: none; }
.world-chat-app .banner {
  margin: 8px 13px 0;
  padding: 8px 10px;
  border: 1px solid rgba(222, 119, 148, .35);
  background: rgba(74, 20, 40, .82);
  color: #ffc0d0;
}
.world-chat-app .messages {
  min-height: 0;
  max-height: none;
  padding: 12px 14px 16px;
  scrollbar-width: none;
}
.world-chat-app .messages::-webkit-scrollbar { display: none; }
.world-chat-app .msg { gap: 7px; margin: 9px 0; }
.world-chat-app .msg .avatar {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(175, 145, 255, .44);
  border-radius: 50%;
  background: rgba(69, 47, 130, .72);
  color: #eee8ff;
  font-size: 9px;
}
.world-chat-app .msg.user .avatar { background: rgba(38, 75, 114, .86); }
.world-chat-app .who { margin: 0 0 3px; color: rgba(217, 207, 242, .58); font-size: 8px; }
.world-chat-app .bubble {
  max-width: min(82%, 280px);
  padding: 8px 10px;
  border: 1px solid rgba(154, 125, 232, .16);
  border-radius: 5px 15px 15px;
  background: rgba(14, 17, 31, .82);
  color: #ece7f8;
  font-size: 11px;
  line-height: 1.55;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
}
.world-chat-app .msg.user .bubble {
  border-color: rgba(165, 132, 255, .34);
  border-radius: 15px 5px 15px 15px;
  background: rgba(83, 56, 164, .66);
  color: #fff;
}
.world-chat-app .temp .bubble { border-color: rgba(178, 147, 255, .52); }
.world-chat-app .typing { min-height: 15px; margin: 0; padding: 0 50px 3px; color: #b89cff; font-size: 9px; }
.world-chat-app .empty { color: var(--world-chat-muted); font-size: 10px; line-height: 1.65; }

.world-chat-app .composer {
  flex: 0 0 auto;
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(154, 122, 242, .16);
  background: rgba(5, 8, 18, .9);
  backdrop-filter: blur(18px);
}
.world-chat-app .mentionbar {
  flex-wrap: nowrap;
  margin-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.world-chat-app .mentionbar::-webkit-scrollbar { display: none; }
.world-chat-app .mentionbar button {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-color: rgba(158, 128, 237, .26);
  background: rgba(30, 26, 57, .75);
  color: #cdbdff;
  font-size: 8px;
}
.world-chat-app .compose-row { gap: 7px; }
.world-chat-app textarea {
  min-height: 40px;
  max-height: 84px;
  padding: 10px 12px;
  border-color: rgba(158, 128, 237, .28);
  border-radius: 18px;
  background: rgba(13, 16, 29, .86);
  color: #f4efff;
  font-size: 11px;
}
.world-chat-app textarea::placeholder { color: rgba(210, 203, 229, .42); }
.world-chat-app .send {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #a98aff;
  border-radius: 50%;
  background: rgba(89, 58, 184, .84);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 0 18px rgba(116, 77, 222, .3);
}
.world-chat-app .send span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.world-chat-app .hint { margin: 5px 2px 0; color: rgba(201, 193, 220, .42); font-size: 8px; }

.world-chat-bottom-nav {
  position: absolute;
  z-index: 18;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 80px;
  min-height: 80px;
  padding: 7px 8px max(8px, env(safe-area-inset-bottom));
  border-top-color: rgba(143, 110, 228, .2);
  background: rgba(4, 7, 15, .94);
  backdrop-filter: blur(16px);
}

.world-chat-shell button:focus-visible,
.world-chat-shell a:focus-visible,
.world-chat-shell textarea:focus-visible {
  outline: 2px solid #c9b2ff;
  outline-offset: 2px;
}
.world-chat-shell button:disabled { cursor: not-allowed; }

body.world-product-page > .modal {
  background: rgba(2, 5, 13, .78);
  color: var(--world-chat-text);
  backdrop-filter: blur(16px);
}
body.world-product-page > .modal .create-card {
  border: 1px solid var(--world-chat-line-strong);
  background: var(--world-chat-panel-strong);
  color: var(--world-chat-text);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .66), 0 0 34px rgba(107, 71, 205, .2);
}
body.world-product-page > .modal .create-head h2,
body.world-product-page > .modal .section-label,
body.world-product-page > .modal .persona-option b { color: #f4efff; }
body.world-product-page > .modal .create-head p,
body.world-product-page > .modal .persona-help,
body.world-product-page > .modal .persona-option span { color: var(--world-chat-muted); }
body.world-product-page > .modal .field { color: rgba(235, 229, 250, .74); }
body.world-product-page > .modal input,
body.world-product-page > .modal textarea {
  border-color: rgba(161, 130, 239, .3);
  background: rgba(11, 14, 27, .9);
  color: #f4efff;
}
body.world-product-page > .modal input::placeholder,
body.world-product-page > .modal textarea::placeholder { color: rgba(208, 198, 230, .4); }
body.world-product-page > .modal .persona-option {
  border-color: rgba(157, 126, 232, .25);
  background: rgba(14, 16, 31, .82);
  color: #eee8ff;
}
body.world-product-page > .modal .persona-option.selected {
  border-color: #a788ff;
  background: rgba(78, 50, 158, .64);
  box-shadow: 0 0 0 2px rgba(142, 101, 255, .12), 0 0 18px rgba(108, 70, 218, .24);
}
body.world-product-page > .modal .model-note {
  border: 1px solid rgba(142, 202, 182, .18);
  background: rgba(13, 35, 35, .62);
  color: #a9dccb;
}
body.world-product-page > .modal .close,
body.world-product-page > .modal .secondary {
  border-color: rgba(157, 126, 232, .26);
  background: rgba(19, 18, 36, .82);
  color: #d9cefa;
}
body.world-product-page > .modal .primary {
  border: 1px solid #a98cff;
  background: rgba(85, 55, 177, .86);
  color: #fff;
}
body.world-product-page > .modal .form-actions { background: transparent; }

@media (max-width: 650px) {
  .world-chat-shell { width: 100% !important; height: 100dvh; border-radius: 0; }
}

@media (max-width: 350px) {
  .world-chat-topbar { grid-template-columns: 36px minmax(0, 1fr); padding-inline: 11px; }
  .world-chat-topbar .mock { display: none; }
  .world-chat-app .context { display: none; }
  .world-chat-app .room-head h2 { max-width: 250px; }
  .world-chat-app .room { min-width: 132px; }
}

@media (max-height: 740px) {
  .world-chat-topbar { height: 58px; padding-top: max(7px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .world-chat-app { inset: 58px 0 66px; grid-template-rows: auto auto minmax(0, 1fr); }
  .world-chat-app .rooms { padding-top: 7px; padding-bottom: 7px; }
  .world-chat-app .rooms .panel-title { margin-bottom: 5px; }
  .world-chat-app .room { padding-block: 6px; }
  .world-chat-app .members { padding-top: 5px; padding-bottom: 5px; }
  .world-chat-app .members .panel-title { display: none; }
  .world-chat-app .room-head { padding-top: 7px; padding-bottom: 7px; }
  .world-chat-app .room-head .world-chat-kicker { display: none; }
  .world-chat-app .messages { padding-top: 8px; padding-bottom: 9px; }
  .world-chat-app .msg { margin: 6px 0; }
  .world-chat-app .composer { padding-top: 6px; padding-bottom: 7px; }
  .world-chat-app .hint { display: none; }
  .world-chat-bottom-nav { height: 66px; min-height: 66px; padding-top: 4px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .world-chat-login { transform: translateY(-44%); }
  body.world-product-page > .modal .form-actions { background: var(--world-chat-panel-strong); }
}

@media (orientation: landscape) and (max-height: 500px) {
  body.world-product-page { padding: 0; }
  .world-chat-shell { width: min(100%, 700px) !important; height: 100dvh; }
  .world-chat-topbar { width: 175px; right: auto; border-right: 1px solid rgba(154, 122, 242, .14); }
  .world-chat-topbar .brand { display: none; }
  .world-chat-app { inset: 0 0 58px 175px; grid-template-rows: auto minmax(0, 1fr); }
  .world-chat-app .rooms { position: absolute; z-index: 4; left: -175px; top: 58px; bottom: 0; width: 175px; border-right: 1px solid rgba(154, 122, 242, .14); }
  .world-chat-app .rooms-list { display: block; }
  .world-chat-app .room { width: 100%; min-width: 0; margin-bottom: 6px; }
  .world-chat-app .members { grid-row: 1; }
  .world-chat-app .chat { grid-row: 2; }
  .world-chat-app .room-head { padding-block: 6px; }
  .world-chat-app .composer { padding-block: 5px; }
  .world-chat-bottom-nav { left: 175px; width: calc(100% - 175px); height: 58px; min-height: 58px; }
  .world-chat-login { left: 190px; right: 20px; max-width: 330px; }
}
