:root {
  --ink: #17202d;
  --muted: #647386;
  --line: #d8e0e8;
  --panel-strong: #ffffff;
  --accent: #2775d1;
  --accent-dark: #1558a4;
  --warm: #f1b748;
  --mint: #2dbb85;
  --rose: #e45771;
  --shadow: 0 18px 54px rgba(29, 42, 58, 0.2);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

html {
  background: #e7dcff;
}

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px 0;
  color: var(--ink);
  font-family:
    "Trebuchet MS", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #48236f 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.game-shell {
  position: relative;
  width: 1020px;
  margin: 0 auto;
  overflow: visible;
  border-radius: 42px 42px 8px 8px;
  box-shadow: var(--shadow);
}

.game-topbar {
  position: relative;
  z-index: 29;
  width: 1020px;
  height: 50px;
  border-radius: 42px 42px 0 0;
  background: linear-gradient(180deg, #1e1d41 0 50%, #554087 50% 100%);
}

.game-logo {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: -78px;
  width: clamp(230px, 28vw, 300px);
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 6px 5px rgba(8, 9, 24, 0.28));
}

.game-loading-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 50px;
  bottom: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  border-radius: 0 0 8px 8px;
  background: #554087;
  color: #ffffff;
  pointer-events: all;
}

.game-loading-overlay.hidden {
  display: none;
}

.loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 44px;
}

.loading-dots span {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92) 0 18%, rgba(255, 255, 255, 0) 19%),
    radial-gradient(circle at 50% 62%, #ffffff 0 46%, #d8c7ff 100%);
  box-shadow:
    inset 0 -4px 6px rgba(42, 24, 83, 0.34),
    inset 0 3px 5px rgba(255, 255, 255, 0.55),
    0 5px 9px rgba(24, 12, 52, 0.35);
  animation: loadingDotBounce 1.05s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.09s; }
.loading-dots span:nth-child(3) { animation-delay: 0.18s; }
.loading-dots span:nth-child(4) { animation-delay: 0.27s; }
.loading-dots span:nth-child(5) { animation-delay: 0.36s; }
.loading-dots span:nth-child(6) { animation-delay: 0.45s; }

.loading-text {
  font-size: 1.88rem;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 3px 8px rgba(24, 12, 52, 0.32);
}

@keyframes loadingDotBounce {
  0%,
  78%,
  100% {
    transform: translateY(0) scale(0.9);
  }
  36% {
    transform: translateY(-18px) scale(1.08);
  }
}

.stage-wrap {
  position: relative;
  width: 1020px;
  height: 680px;
  overflow: hidden;
  background: #d8e8ef;
}

#world {
  display: block;
  width: 1020px;
  height: 680px;
  cursor: pointer;
  outline: none;
}

.cinema-video-layer {
  position: absolute;
  left: 30%;
  top: 20.75%;
  z-index: 2;
  width: 39.7%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050506;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 222, 147, 0.18);
  pointer-events: none;
}

.cinema-video-layer.hidden {
  display: none;
}

#cinemaVideoMount,
#cinemaVideoMount iframe {
  width: 100%;
  height: 100%;
}

#cinemaVideoMount iframe {
  display: block;
  border: 0;
}

.stage-hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.avatar-hud {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 55px;
  height: 55px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 30%, #ffffff 0 24%, #dff6ff 25% 62%, #9be1ff 63% 100%);
  box-shadow:
    inset 0 0 0 2px rgba(61, 58, 118, 0.2),
    0 5px 12px rgba(8, 9, 24, 0.24);
}

.avatar-hud img {
  position: absolute;
  left: 50%;
  top: -4px;
  width: auto;
  height: 92px;
  transform: translateX(-50%);
}

.emerald-bar {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 190px;
  height: 45px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 23px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 241, 250, 0.96));
  box-shadow: 0 5px 12px rgba(8, 9, 24, 0.2);
}

.emerald-icon {
  position: absolute;
  left: 6px;
  top: 50%;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: url("/assets/coin.png") center / contain no-repeat;
  filter: drop-shadow(0 3px 5px rgba(91, 49, 132, 0.34));
  transform: translateY(-50%);
}

#emeraldAmount {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #201932;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.bottom-menu {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 360px 1fr;
  align-items: center;
  gap: 16px;
  width: 1020px;
  height: 80px;
  padding: 0 28px;
  border-top: 1px solid rgba(24, 34, 47, 0.12);
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, 0.96);
}

.menu-left,
.menu-right {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 0;
  width: 100%;
}

.menu-left {
  justify-items: center;
}

.menu-right {
  justify-items: center;
}

.menu-icon {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  transform-origin: 50% 80%;
}

.menu-icon img {
  display: block;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(43, 19, 78, 0.24));
  pointer-events: none;
}

.menu-icon:hover {
  animation: menuIconBounce 0.46s ease-in-out both;
}

.menu-icon:focus-visible {
  outline: 2px solid rgba(85, 64, 135, 0.65);
  outline-offset: 3px;
}

@keyframes menuIconBounce {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  28% {
    transform: translateY(-7px) rotate(-5deg) scale(1.08);
  }
  48% {
    transform: translateY(0) rotate(4deg) scale(0.98);
  }
  68% {
    transform: translateY(-3px) rotate(-3deg) scale(1.04);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

.menu-icon.phone::before {
  inset: 8px 13px;
  border-radius: 7px;
  background: #323943;
  transform: rotate(-26deg);
}

.menu-icon.phone::after {
  left: 19px;
  bottom: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #eef5fb;
}

.menu-icon.hands::before,
.menu-icon.hands::after {
  top: 13px;
  width: 16px;
  height: 18px;
  border-radius: 45% 45% 55% 55%;
  background: #f1c6a8;
  box-shadow: inset -2px -2px 0 rgba(138, 91, 64, 0.18);
}

.menu-icon.hands::before {
  left: 8px;
  transform: rotate(-24deg);
}

.menu-icon.hands::after {
  right: 8px;
  transform: rotate(24deg);
}

.menu-icon.shirt::before {
  left: 10px;
  top: 11px;
  width: 22px;
  height: 23px;
  border-radius: 7px 7px 4px 4px;
  background: #20a6dc;
  box-shadow:
    -9px 4px 0 -2px #20a6dc,
    9px 4px 0 -2px #20a6dc;
}

.menu-icon.bag::before {
  left: 9px;
  top: 15px;
  width: 24px;
  height: 20px;
  border-radius: 6px;
  background: #d66d2f;
  box-shadow: inset 0 -4px 0 rgba(105, 54, 24, 0.22);
}

.menu-icon.bag::after {
  left: 15px;
  top: 8px;
  width: 12px;
  height: 12px;
  border: 3px solid #8c4322;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.menu-icon.dance::before {
  left: 17px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b54ce2;
  box-shadow:
    -6px 14px 0 0 #b54ce2,
    6px 14px 0 0 #b54ce2;
}

.menu-icon.dance::after {
  left: 18px;
  top: 16px;
  width: 6px;
  height: 23px;
  border-radius: 5px;
  background: #b54ce2;
  transform: rotate(28deg);
}

.menu-icon.help::before {
  content: "?";
  inset: auto;
  left: 14px;
  top: 5px;
  color: #12a8cd;
  font-size: 27px;
  font-weight: 900;
}

.menu-icon.history::before {
  left: 9px;
  top: 10px;
  width: 24px;
  height: 22px;
  border-radius: 8px;
  background: #ffffff;
  border: 3px solid #49a7d8;
  box-shadow: inset 0 -6px 0 rgba(73, 167, 216, 0.14);
}

.menu-icon.history::after {
  left: 16px;
  top: 18px;
  width: 12px;
  height: 3px;
  border-radius: 3px;
  background: #49a7d8;
  box-shadow: 0 6px 0 #49a7d8;
}

.menu-icon.smile::before {
  left: 8px;
  top: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #35c8d0;
}

.menu-icon.smile::after {
  left: 15px;
  top: 18px;
  width: 13px;
  height: 7px;
  border-bottom: 3px solid #1c6f77;
  border-radius: 0 0 12px 12px;
}

.menu-icon.trophy::before {
  left: 13px;
  top: 7px;
  width: 16px;
  height: 19px;
  border-radius: 3px 3px 9px 9px;
  background: #e68b18;
}

.menu-icon.trophy::after {
  left: 17px;
  top: 25px;
  width: 8px;
  height: 11px;
  background: #b96b11;
  box-shadow: -6px 10px 0 -2px #b96b11, 6px 10px 0 -2px #b96b11;
}

.menu-icon.island::before {
  left: 7px;
  bottom: 8px;
  width: 29px;
  height: 10px;
  border-radius: 50%;
  background: #8cc95f;
}

.menu-icon.island::after {
  left: 19px;
  top: 9px;
  width: 4px;
  height: 23px;
  border-radius: 3px;
  background: #8a5a44;
  transform: rotate(12deg);
  box-shadow: -6px -5px 0 2px #55aa48, 7px -6px 0 2px #55aa48;
}

.menu-icon.jewel::before {
  left: 8px;
  top: 7px;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #f045a5, #c71877);
  clip-path: polygon(50% 0, 100% 38%, 50% 100%, 0 38%);
}

.chat-form {
  --chat-bubble-color: #fff3b0;
  display: flex;
  position: relative;
  justify-content: center;
  width: 360px;
}

.chat-form input {
  width: 360px;
  height: 52px;
  border: 1px solid #aeb4bd;
  border-radius: 28px;
  padding: 0 64px 0 24px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34)),
    var(--chat-bubble-color);
  color: #222a35;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  font-weight: 800;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.chat-form input::placeholder {
  color: #777f8c;
  opacity: 1;
}

.chat-form input:hover::placeholder,
.chat-form input:focus::placeholder {
  opacity: 0;
}

.chat-color-picker {
  position: absolute;
  right: 8px;
  top: 50%;
  z-index: 8;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
}

.chat-color-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(95, 111, 132, 0.34);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 10px rgba(35, 45, 60, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-color-button img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
}

.chat-color-picker:hover .chat-color-button,
.chat-color-picker:focus-within .chat-color-button,
.chat-color-picker.open .chat-color-button {
  transform: translateY(-5px) scale(1.12);
  box-shadow: 0 10px 18px rgba(35, 45, 60, 0.18);
}

.chat-color-palette {
  position: absolute;
  right: -4px;
  bottom: 44px;
  display: flex;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(125, 137, 156, 0.22);
  border-radius: 18px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(35, 45, 60, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.92);
  transform-origin: bottom right;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.2, 1.35, 0.42, 1);
}

.chat-color-picker:hover .chat-color-palette,
.chat-color-picker:focus-within .chat-color-palette,
.chat-color-picker.open .chat-color-palette {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-color-palette button {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 7px;
  padding: 0;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(87, 98, 116, 0.18), 0 4px 10px rgba(35, 45, 60, 0.12);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.chat-color-palette button:hover,
.chat-color-palette button.selected {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 0 2px rgba(111, 78, 184, 0.34), 0 7px 14px rgba(35, 45, 60, 0.16);
}

.toast {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: min(360px, calc(100% - 28px));
  border: 1px solid rgba(24, 34, 47, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(29, 42, 58, 0.16);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.profile-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 31;
  width: 330px;
  height: 485px;
  padding: 52px 24px 22px;
  border: 0;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(196, 87, 255, 0.94) 0%, rgba(165, 42, 220, 0.98) 42%, rgba(130, 20, 198, 0.98) 100%),
    radial-gradient(ellipse at 54% 30%, rgba(255, 255, 255, 0.18) 0 16%, rgba(255, 255, 255, 0.05) 38%, transparent 62%),
    #9f27d9;
  box-shadow:
    inset 0 0 0 3px rgba(72, 4, 122, 0.72),
    inset 0 18px 34px rgba(255, 255, 255, 0.18),
    inset 0 -16px 22px rgba(38, 0, 82, 0.22),
    0 24px 44px rgba(18, 10, 39, 0.36);
  color: #fff;
  transform: translate(-50%, -50%);
  user-select: none;
}

.profile-panel::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: -1;
  border-radius: 26px;
  background: rgba(232, 200, 255, 0.52);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.76),
    inset 0 0 0 8px rgba(161, 88, 207, 0.2),
    0 0 19px rgba(235, 202, 255, 0.5);
}

.profile-panel::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 2px solid rgba(248, 222, 255, 0.58);
  border-radius: 15px;
  pointer-events: none;
}

.profile-panel.hidden {
  display: none;
}

.profile-drag-area {
  position: absolute;
  inset: 0 0 auto 0;
  height: 150px;
  cursor: move;
}

.profile-close {
  position: absolute;
  left: -30px;
  top: -28px;
  z-index: 2;
  width: 56px;
  height: 56px;
  border: 3px solid rgba(248, 224, 255, 0.96);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 28%),
    radial-gradient(circle at 38% 28%, #d987ff 0 22%, #9f35d3 56%, #5f0f98 100%);
  box-shadow:
    0 7px 13px rgba(31, 10, 67, 0.34),
    inset 0 2px 5px rgba(255, 255, 255, 0.52),
    inset 0 -6px 9px rgba(34, 5, 69, 0.34);
  color: #f9efff;
  font-size: 0;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 2px rgba(43, 8, 75, 0.36);
  cursor: pointer;
}

.profile-close::before,
.profile-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 31px;
  height: 6px;
  border-radius: 999px;
  background: #f7eaff;
  box-shadow: 0 2px 2px rgba(58, 12, 84, 0.3);
  transform-origin: center;
}

.profile-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.profile-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.profile-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 112px;
}

.profile-avatar-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 118px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffaf0, #f3ead6);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.82),
    0 0 0 6px rgba(187, 119, 224, 0.44),
    0 7px 13px rgba(31, 8, 65, 0.38);
  overflow: hidden;
}

.profile-avatar-box::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  padding: 4px;
  background: linear-gradient(145deg, #ffffff, #dfc5ff 34%, #6d238f 72%, #ffffff);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.profile-avatar-box img {
  max-width: 100%;
  height: 88px;
  object-fit: contain;
  object-position: center center;
}

.profile-head h3 {
  margin: 0 0 16px;
  max-width: 160px;
  overflow: hidden;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(70, 22, 120, 0.42);
}

.profile-actions {
  display: flex;
  gap: 7px;
  max-width: 170px;
}

.profile-actions button {
  width: 34px;
  height: 34px;
  border: 2px solid #f4e9ff;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 24%, #ffffff 0 22%, #efe6ff 48%, #c9abd9 100%);
  box-shadow: 0 4px 0 #4e226d, 0 6px 9px rgba(24, 7, 50, 0.28);
  color: #6c2396;
  font-size: 0.78rem;
  font-weight: 1000;
  cursor: pointer;
}

.profile-actions button:disabled {
  cursor: default;
  opacity: 0.58;
}

.profile-actions button.active {
  color: #fff;
  background: radial-gradient(circle at 36% 24%, #f6d8ff 0 16%, #9c3bd0 56%, #6921a1 100%);
}

.profile-bio-title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 30px;
  margin: 8px -4px 8px;
  padding: 9px 0 0;
  border-top: 2px solid rgba(77, 12, 122, 0.48);
}

.profile-bio-title span {
  display: none;
}

.profile-bio-edit {
  position: relative;
  right: 0;
  width: 29px;
  height: 29px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 25%, #ffffff 0 22%, #f2e6ff 54%, #c69be1 100%);
  color: #7224a5;
  font-weight: 1000;
  box-shadow: 0 4px 8px rgba(36, 8, 63, 0.22);
  cursor: pointer;
}

.profile-bio-box {
  width: 100%;
  height: 196px;
  border: 3px solid #52206f;
  border-radius: 13px;
  padding: 12px;
  background: linear-gradient(180deg, #fff7ff, #f4ddff);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.85),
    inset 0 5px 12px rgba(122, 46, 176, 0.12);
  color: #39234e;
  user-select: text;
}

.profile-bio-box p,
.profile-bio-box textarea {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 800 0.92rem/1.42 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  outline: none;
  resize: none;
  white-space: pre-wrap;
}

.profile-bio-controls {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin-top: 6px;
}

.profile-bio-controls button {
  border: 0;
  border-radius: 8px;
  padding: 6px 11px;
  background: #fff;
  color: #6d249f;
  font-weight: 900;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 24, 38, 0.46);
  backdrop-filter: blur(8px);
}

.modal-backdrop.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.login-card {
  position: relative;
  width: min(560px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.landing-auth {
  display: block;
  overflow: hidden;
  width: 100vw;
  min-height: 100vh;
  padding: 44px clamp(24px, 12.5vw, 200px) 54px;
  background:
    linear-gradient(180deg, rgba(84, 42, 171, 0.22), rgba(255, 255, 255, 0.34) 78%, rgba(244, 236, 255, 0.9)),
    url("/assets/landing/background.jpg") center / cover no-repeat;
  background-color: #e7dcff;
  backdrop-filter: none;
}

.landing-auth::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(60, 28, 126, 0.24), rgba(255, 255, 255, 0.02) 46%, rgba(93, 42, 151, 0.2)),
    linear-gradient(180deg, rgba(95, 49, 184, 0.24), rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0.62));
}

.landing-auth::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -58px;
  height: 190px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(252, 248, 255, 0.9) 0 20%, rgba(232, 211, 255, 0.72) 43%, rgba(232, 211, 255, 0) 74%),
    linear-gradient(180deg, rgba(232, 211, 255, 0), rgba(232, 211, 255, 0.72));
  filter: blur(7px);
}

.landing-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(390px, 430px);
  gap: clamp(34px, 6vw, 82px);
  align-items: center;
  width: 100%;
  max-width: 1200px;
  min-height: min(780px, calc(100vh - 130px));
  margin: 0 auto;
}

.landing-showcase {
  position: relative;
  min-height: 720px;
}

.landing-logo {
  position: absolute;
  left: 150px;
  top: -4px;
  z-index: 3;
  width: 300px;
  height: auto;
  filter: drop-shadow(0 10px 10px rgba(43, 13, 94, 0.34));
  user-select: none;
  pointer-events: none;
}

.landing-characters {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 2;
  width: 440px;
  height: 445px;
  pointer-events: none;
  transform: translateX(-50%);
}

.landing-character {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: auto;
  height: 445px;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 20px 14px rgba(35, 13, 58, 0.26));
  transform: translateX(-50%);
  user-select: none;
}

.landing-promo {
  position: absolute;
  left: 8px;
  right: 0;
  bottom: 26px;
  z-index: 4;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  align-items: center;
  width: min(690px, 100%);
  min-height: 66px;
  border-radius: 10px;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(124, 70, 213, 0.86), rgba(99, 43, 180, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 16px 34px rgba(75, 31, 130, 0.32);
  color: #fff;
}

.landing-promo img {
  display: block;
  width: 58px;
  height: 50px;
  object-fit: contain;
}

.landing-promo strong,
.landing-promo span {
  display: block;
  text-shadow: 0 2px 5px rgba(43, 17, 83, 0.35);
}

.landing-promo strong {
  font-size: 1.01rem;
  font-weight: 900;
}

.landing-promo span {
  margin-top: 5px;
  font-size: 0.94rem;
  font-weight: 800;
}

.landing-card {
  align-self: center;
  width: 100%;
  max-height: calc(100vh - 88px);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  padding: 47px 50px 40px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 0.94) 44%, rgba(250, 248, 255, 0.96) 100%);
  box-shadow:
    0 28px 72px rgba(48, 19, 91, 0.3),
    0 0 0 1px rgba(117, 79, 195, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.landing-card::after {
  content: "";
  position: absolute;
  left: 44px;
  right: 44px;
  bottom: -34px;
  height: 46px;
  border-radius: 50%;
  background: rgba(149, 90, 230, 0.42);
  filter: blur(18px);
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  color: transparent;
  font-size: 0;
}

.login-card h2 {
  margin: 0;
  color: #171630;
  font-size: 2.14rem;
  font-weight: 900;
  line-height: 1.19;
  letter-spacing: 0;
  text-align: center;
}

.login-card h2::first-line {
  color: #7a23dc;
}

.landing-subtitle {
  max-width: 335px;
  margin: 22px auto 28px;
  color: #4e5265;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
}

.landing-register-button,
.landing-submit {
  width: 100%;
  min-height: 78px;
  border: 0;
  border-radius: 9px;
  padding: 0 18px;
  background: linear-gradient(180deg, #a634eb 0%, #7618d9 52%, #5515ca 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 18px rgba(85, 31, 171, 0.3);
  color: #fff;
  font-size: 1.43rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.landing-register-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.landing-register-button:hover,
.landing-submit:hover {
  background: linear-gradient(180deg, #b33cff 0%, #8320e7 52%, #5b18d3 100%);
}

.gamepad-icon {
  display: block;
  width: 48px;
  height: 33px;
  object-fit: contain;
}

.landing-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 15px;
  align-items: center;
  margin: 33px 0 31px;
  color: #a4a3b0;
  font-size: 1rem;
  font-weight: 850;
}

.landing-divider::before,
.landing-divider::after {
  content: "";
  height: 1px;
  background: #e4e2ec;
}

.auth-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.landing-auth-mode {
  display: none;
}

.auth-panel-title {
  margin: 0 0 18px;
  color: #202039;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
}

.field-label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.landing-input {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  margin-bottom: 16px;
  border: 1px solid #d9dce6;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    inset 0 2px 4px rgba(40, 33, 67, 0.04),
    0 4px 8px rgba(54, 44, 83, 0.04);
}

.login-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.landing-input input {
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  padding: 0 46px 0 52px;
  background: transparent;
  color: #202039;
  font-size: 0.96rem;
  font-weight: 800;
}

.landing-input input::placeholder {
  color: #8f93a3;
  opacity: 1;
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 117, 209, 0.14);
}

.landing-input:focus-within {
  border-color: rgba(126, 51, 218, 0.54);
  box-shadow:
    0 0 0 3px rgba(126, 51, 218, 0.1),
    inset 0 2px 4px rgba(40, 33, 67, 0.04);
}

.landing-input input:focus {
  box-shadow: none;
}

.auth-error {
  margin: 0 0 12px;
  color: #d94b69;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.input-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 22px;
  height: 25px;
  object-fit: contain;
  transform: translateY(-50%);
}

.password-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 28px;
  height: 22px;
  border: 0;
  padding: 0;
  background: transparent;
  transform: translateY(-50%);
}

.password-eye::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 5px;
  width: 21px;
  height: 12px;
  border: 2px solid #858997;
  border-radius: 50%;
}

.password-eye::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #858997;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 3px 0 25px;
  color: #6d7180;
  font-size: 0.88rem;
  font-weight: 850;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.remember-check input {
  width: 22px;
  min-height: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid #b7bbc7;
  border-radius: 5px;
  accent-color: #8b24e5;
}

.forgot-link,
.landing-join button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #8f2be5;
  font-weight: 900;
}

.landing-submit {
  min-height: 58px;
  margin-top: 0;
  font-size: 1.14rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 18px rgba(74, 25, 151, 0.32);
}

.landing-join {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 26px 0 0;
  color: #5d6070;
  font-size: 0.96rem;
  font-weight: 800;
}

.join-register-copy,
#landingSwitchLogin {
  display: none;
}

.register-mode .join-login-copy,
.register-mode #landingSwitchRegister {
  display: none;
}

.register-mode .join-register-copy,
.register-mode #landingSwitchLogin {
  display: inline;
}

.register-mode .landing-register-button,
.register-mode .landing-divider {
  display: none;
}

.register-mode .login-options {
  display: none;
}

.profile-mode .landing-register-button,
.profile-mode .landing-divider,
.profile-mode .login-options,
.profile-mode .landing-join {
  display: none;
}

.profile-mode .landing-card {
  max-height: min(760px, calc(100vh - 96px));
  overflow: auto;
}

.customize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 14px;
}

.color-choices {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.color-choices.compact {
  grid-template-columns: repeat(4, minmax(34px, 1fr));
}

.color-choice {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--avatar-color);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.64);
}

.color-choice.selected {
  border-color: var(--ink);
}

.segmented-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.segment-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.segment-button.selected {
  border-color: rgba(39, 117, 209, 0.55);
  background: rgba(39, 117, 209, 0.11);
  color: var(--accent-dark);
}

.primary-button {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

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

.primary-button.landing-submit {
  min-height: 58px;
  margin-top: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #a634eb 0%, #7618d9 52%, #5515ca 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 18px rgba(74, 25, 151, 0.32);
  font-size: 1.14rem;
}

.primary-button.landing-submit:hover {
  background: linear-gradient(180deg, #b33cff 0%, #8320e7 52%, #5b18d3 100%);
}

.avatar-picker {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.gender-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.avatar-preview {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.avatar-preview img {
  display: block;
  max-width: 180px;
  max-height: 180px;
  object-fit: contain;
}

.avatar-turn-controls {
  display: grid;
  grid-template-columns: 44px 44px;
  justify-content: center;
  gap: 12px;
}

.turn-button {
  width: 44px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.turn-button:hover {
  border-color: rgba(39, 117, 209, 0.48);
  background: rgba(39, 117, 209, 0.08);
}

.landing-footer {
  position: absolute;
  left: clamp(24px, 12.5vw, 200px);
  right: clamp(24px, 12.5vw, 200px);
  bottom: 17px;
  z-index: 2;
  display: grid;
  gap: 13px;
  justify-items: center;
  color: rgba(73, 67, 91, 0.58);
  font-size: 0.8rem;
  font-weight: 850;
}

.landing-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
}

.landing-footer a {
  color: inherit;
  text-decoration: none;
}

@media (min-width: 981px) {
  .landing-auth {
    padding: 0;
  }

  .landing-shell {
    position: absolute;
    left: 50%;
    top: calc(50% - 8px);
    display: block;
    width: 1200px;
    height: 780px;
    min-height: 0;
    max-width: none;
    margin: 0;
    transform: translate(-50%, -50%) scale(var(--landing-scale, 1));
    transform-origin: center center;
  }

  .landing-showcase {
    position: absolute;
    left: 0;
    top: 0;
    width: 690px;
    height: 100%;
    min-height: 0;
  }

  .landing-logo {
    left: 345px;
    top: 34px;
    width: 300px;
    transform: translateX(-50%);
  }

  .landing-characters {
    left: 345px;
    bottom: 124px;
    width: 440px;
    height: 445px;
  }

  .landing-character {
    height: 445px;
  }

  .landing-promo {
    left: 0;
    right: auto;
    bottom: 58px;
    width: 690px;
    min-height: 66px;
  }

  .landing-card {
    position: absolute;
    right: 0;
    top: 34px;
    bottom: 58px;
    width: 430px;
    max-height: none;
    overflow: visible;
    padding: 47px 50px 34px;
  }
}

.tool-panel {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: 320px;
  max-height: 560px;
  border: 1px solid rgba(24, 34, 47, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  z-index: 30;
}

.tool-panel.hidden {
  display: none;
}

.tool-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
  user-select: none;
}

.tool-panel.dragging .tool-panel-head {
  cursor: grabbing;
}

.panel-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #edf2f7;
  color: var(--ink);
  font-weight: 900;
}

.tool-panel-body {
  display: grid;
  gap: 10px;
  max-height: 500px;
  overflow: auto;
  padding: 12px;
}

.furniture-catalog-row,
.furniture-placed-row {
  grid-template-columns: 54px 1fr auto;
  align-items: center;
}

.furniture-placed-row {
  grid-template-columns: 54px 1fr auto auto;
}

.furniture-catalog-row img,
.furniture-placed-row img {
  width: 48px;
  height: 44px;
  object-fit: contain;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(91, 65, 143, 0.12);
  pointer-events: none;
}

.tool-panel[data-panel="chat-history"] {
  width: 320px;
  height: 560px;
  max-height: none;
  background: #f3fbff;
}

.tool-panel[data-panel="chat-history"] .tool-panel-head {
  min-height: 44px;
  border-bottom: 0;
  background: linear-gradient(135deg, #1d94ed 0%, #2aa5f5 58%, #1685dd 100%);
  color: #fff;
}

.tool-panel[data-panel="chat-history"] .panel-close {
  background: #f44234;
  color: #fff;
}

.tool-panel[data-panel="chat-history"] .tool-panel-body {
  display: flex;
  height: calc(100% - 44px);
  max-height: none;
  overflow: hidden;
  padding: 0 12px 12px;
}

.panel-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.panel-row small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.area-editor-panel {
  display: grid;
  gap: 10px;
}

.area-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

.area-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.area-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(24, 34, 47, 0.18);
}

.area-dot.walkable {
  background: #27d269;
}

.area-dot.blocked {
  background: #ff3648;
}

.area-dot.entry {
  background: #ff9b22;
}

.panel-wide-button {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.panel-wide-button.subtle {
  background: #edf2f7;
  color: var(--ink);
}

.area-placement-active {
  display: grid;
  gap: 7px;
  border: 2px solid #ffb32d;
  border-radius: 8px;
  padding: 9px;
  background: linear-gradient(180deg, #fff7dc, #ffe7a3);
  color: #55320a;
  box-shadow: 0 8px 18px rgba(255, 155, 34, 0.22);
}

.area-placement-active strong {
  font-size: 13px;
}

.area-placement-active small {
  color: #7c4d0f;
  font-weight: 850;
  line-height: 1.35;
}

.area-door-builder {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.area-door-builder label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.area-section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.area-door-builder input,
.area-door-builder select,
.area-portal-controls select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  background: #f9fbff;
}

.area-facing-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.area-facing-row.compact {
  gap: 5px;
}

.area-facing-row button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #edf2f7;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  padding: 4px 5px;
}

.area-facing-row button.selected {
  background: var(--accent);
  color: #fff;
}

.area-portal-list {
  display: grid;
  gap: 8px;
}

.area-portal-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.area-portal-row small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.area-portal-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.area-portal-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.area-portal-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.area-portal-actions button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #edf2f7;
  color: var(--ink);
  font-weight: 900;
}

.settings-panel {
  display: grid;
  gap: 10px;
}

.settings-row {
  min-height: 54px;
}

.sound-toggle {
  position: relative;
  display: inline-grid;
  width: 54px;
  height: 30px;
  place-items: center;
  cursor: pointer;
}

.sound-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sound-toggle span {
  position: relative;
  display: block;
  width: 50px;
  height: 26px;
  border-radius: 999px;
  background: #d7ddea;
  box-shadow: inset 0 2px 5px rgba(24, 34, 47, 0.18);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.sound-toggle span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(24, 34, 47, 0.22);
  transition: transform 0.18s ease;
}

.sound-toggle input:checked + span {
  background: #554087;
  box-shadow: inset 0 2px 5px rgba(30, 29, 65, 0.28);
}

.sound-toggle input:checked + span::after {
  transform: translateX(24px);
}

.cinema-panel {
  display: grid;
  gap: 10px;
}

.cinema-panel .panel-form {
  grid-template-columns: 1fr auto;
}

.cinema-panel-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cinema-panel-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: #554087;
  color: #fff;
  font-weight: 900;
}

.npc-panel {
  display: grid;
  gap: 10px;
}

.npc-card {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  cursor: grab;
}

.npc-card:active {
  cursor: grabbing;
}

.npc-card img {
  width: 44px;
  height: 58px;
  object-fit: contain;
}

.npc-card small,
.npc-row-head small,
.npc-message-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.npc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  font-weight: 850;
}

.npc-message-field,
.npc-placed-row {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.npc-message-field textarea,
.npc-placed-row textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font: 800 12px system-ui;
}

.npc-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.npc-card button,
.npc-row-actions button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  background: #554087;
  color: #fff;
  font-weight: 850;
}

.npc-row-actions button[data-npc-remove] {
  background: #e45771;
}

.panel-row button,
.panel-form button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 850;
}

.panel-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.panel-form input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.chat-history-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.chat-history-search {
  display: block;
  width: 240px;
  margin: 0 auto 10px;
}

.chat-history-search input {
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 0 0 18px 18px;
  padding: 0 42px 0 24px;
  background: #bfe3ff;
  color: #15171b;
  font-weight: 850;
  outline: none;
}

.chat-history-list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 8px 4px 4px;
  scrollbar-width: thin;
}

.chat-history-row {
  display: grid;
  gap: 3px;
  width: fit-content;
  max-width: 74%;
  border: 1px solid rgba(172, 232, 150, 0.95);
  border-radius: 18px;
  padding: 8px 10px;
  background: #fff;
  color: #15171b;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 5px 12px rgba(24, 34, 47, 0.08);
}

.chat-history-row.own {
  align-self: flex-end;
  text-align: right;
  background: #eef9ff;
}

.chat-history-row strong {
  font-weight: 900;
}

.chat-history-row span {
  overflow-wrap: anywhere;
}

.chat-history-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.notice-card {
  max-width: 430px;
}

@media (max-width: 1220px) {
  .game-shell {
    width: calc(100vw - 20px);
    margin: 0 auto;
  }

  .stage-wrap,
  #world,
  .game-topbar,
  .bottom-menu {
    width: 100%;
  }

  .stage-wrap,
  #world {
    height: auto;
    aspect-ratio: 3 / 2;
  }

  .bottom-menu {
    grid-template-columns: 1fr minmax(260px, 360px) 1fr;
  }
}

@media (max-height: 820px) {
  body {
    align-items: flex-start;
    padding-top: 82px;
    padding-bottom: 16px;
  }
}

@media (max-width: 760px) {
  .bottom-menu {
    grid-template-columns: 1fr;
    height: auto;
    gap: 10px;
    padding: 12px;
  }

  .menu-left,
  .menu-right {
    justify-content: center;
  }

  .chat-form,
  .chat-form input {
    width: min(360px, 100%);
  }

  .customize-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1220px) {
  .landing-auth {
    padding-inline: clamp(28px, 6vw, 86px);
  }

  .landing-shell {
    grid-template-columns: minmax(430px, 1fr) minmax(360px, 410px);
    gap: 32px;
  }

  .landing-logo {
    left: 50%;
    width: 260px;
  }

  .landing-characters {
    left: 50%;
    width: 440px;
    height: 445px;
  }

  .landing-character {
    height: 445px;
  }
}

@media (max-height: 860px) and (min-width: 981px) {
  .landing-auth {
    padding-top: 28px;
    padding-bottom: 42px;
  }

  .landing-shell {
    min-height: min(700px, calc(100vh - 86px));
  }

  .landing-showcase {
    min-height: 650px;
  }

  .landing-logo {
    top: -10px;
    width: 260px;
  }

  .landing-character {
    height: 445px;
  }

  .landing-promo {
    bottom: 12px;
  }

  .landing-card {
    padding: 34px 42px 31px;
  }

  .login-card h2 {
    font-size: 1.92rem;
  }

  .landing-subtitle {
    margin: 16px auto 22px;
  }

  .landing-register-button {
    min-height: 66px;
  }

  .landing-divider {
    margin: 24px 0 22px;
  }
}

@media (max-width: 980px) {
  .landing-auth {
    overflow: auto;
    padding: 26px 24px 36px;
  }

  .landing-shell {
    display: block;
    min-height: auto;
    max-width: 440px;
  }

  .landing-showcase {
    min-height: 128px;
  }

  .landing-logo {
    position: relative;
    left: 50%;
    top: 0;
    width: min(280px, 82vw);
    transform: translateX(-50%);
  }

  .landing-characters,
  .landing-promo,
  .landing-footer {
    display: none;
  }

  .landing-card {
    padding: 34px 26px 30px;
    border-radius: 24px;
  }

  .login-card h2 {
    font-size: 1.82rem;
  }

  .landing-subtitle {
    margin: 16px auto 22px;
  }

  .landing-register-button {
    min-height: 62px;
    font-size: 1.16rem;
  }

  .login-options,
  .landing-join {
    flex-wrap: wrap;
  }
}
