:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cream: #fff0d7;
  --gold: #f7bc5d;
  --cyan: #42dcff;
  --wood-a: #8b4a22;
  --wood-b: #170704;
  background: #050303;
  color: var(--cream);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050303;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

.amerc-app,
.tavern-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.tavern-stage {
  z-index: 0;
  height: 100svh;
  background: #050303;
}

.tavern-stage canvas,
.webgl-fallback {
  display: block;
  width: 100%;
  height: 100%;
}

.tavern-stage canvas {
  cursor: grab;
  touch-action: none;
}

.webgl-fallback {
  background:
    radial-gradient(circle at 50% 28%, rgba(44, 214, 255, 0.22), transparent 30%),
    linear-gradient(180deg, #170c07, #050303 70%);
}

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

.wood-topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  display: grid;
  width: 100%;
  min-height: 74px;
  grid-template-columns: minmax(220px, 306px) 1fr auto;
  align-items: start;
  padding: 7px 28px 0 12px;
  pointer-events: none;
}

.wood-topbar::before {
  position: absolute;
  top: 16px;
  right: 28px;
  left: 224px;
  height: 50px;
  border: 3px solid #3f1b0b;
  border-radius: 7px;
  background:
    radial-gradient(ellipse at 18% 40%, rgba(31, 9, 3, 0.54) 0 9px, rgba(144, 70, 26, 0.18) 10px 18px, transparent 20px),
    radial-gradient(ellipse at 66% 58%, rgba(22, 7, 2, 0.5) 0 7px, rgba(167, 86, 32, 0.18) 8px 17px, transparent 19px),
    repeating-linear-gradient(0deg, rgba(255, 226, 160, 0.09) 0 2px, transparent 2px 15px),
    repeating-linear-gradient(90deg, rgba(18, 6, 2, 0.18) 0 4px, transparent 4px 112px),
    linear-gradient(180deg, #8a471f 0%, #5a2a12 36%, #2d1207 72%, #130602 100%);
  box-shadow:
    inset 0 4px 0 rgba(255, 224, 150, 0.24),
    inset 0 -7px 0 rgba(0, 0, 0, 0.54),
    inset 0 0 0 1px rgba(255, 206, 112, 0.13),
    0 16px 32px rgba(0, 0, 0, 0.62),
    0 2px 0 rgba(255, 210, 126, 0.1);
  content: "";
  pointer-events: auto;
}

.wood-topbar::after {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 48px;
  height: 64px;
  border: 3px solid #4b1e0b;
  border-radius: 5px;
  background:
    radial-gradient(circle at 50% 22%, #8ff5ff 0 12px, #006cff 13px 20px, transparent 21px),
    radial-gradient(ellipse at 36% 68%, rgba(18, 5, 1, 0.42), transparent 24px),
    linear-gradient(180deg, #8a451d, #2f1307);
  box-shadow:
    inset 0 2px 0 rgba(255, 220, 145, 0.2),
    0 0 22px rgba(32, 170, 255, 0.42),
    0 10px 28px rgba(0, 0, 0, 0.48);
  content: "";
  transform: translateX(-50%) rotate(45deg);
  pointer-events: none;
}

.logo-plaque,
.wood-nav,
.wood-menu,
.wood-mobile {
  position: relative;
  pointer-events: auto;
}

.logo-plaque {
  display: grid;
  width: min(286px, calc(100vw - 84px));
  min-height: 76px;
  place-items: center;
  padding: 6px 18px 9px;
  border: 4px solid #3f1a09;
  border-radius: 9px;
  background:
    radial-gradient(ellipse at 24% 42%, rgba(22, 6, 2, 0.52) 0 10px, rgba(143, 70, 25, 0.22) 11px 21px, transparent 23px),
    radial-gradient(ellipse at 72% 63%, rgba(20, 6, 2, 0.5) 0 8px, rgba(178, 92, 34, 0.18) 9px 20px, transparent 22px),
    repeating-linear-gradient(0deg, rgba(255, 228, 166, 0.11) 0 2px, transparent 2px 17px),
    repeating-linear-gradient(90deg, rgba(15, 5, 1, 0.18) 0 4px, transparent 4px 92px),
    linear-gradient(180deg, #8c4a22 0%, #5c2a12 42%, #2a1107 74%, #120602 100%);
  box-shadow:
    inset 0 5px 0 rgba(255, 228, 156, 0.26),
    inset 0 -8px 0 rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px rgba(255, 202, 110, 0.14),
    0 18px 34px rgba(0, 0, 0, 0.48);
  cursor: pointer;
}

.logo-plaque::before,
.logo-plaque::after,
.wood-nav::before,
.wood-nav::after {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid #331305;
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 200, 104, 0.25), transparent 42%),
    linear-gradient(180deg, #a15a24, #4c210e);
  box-shadow:
    inset 0 2px 0 rgba(255, 215, 143, 0.24),
    0 2px 0 rgba(0, 0, 0, 0.38);
  content: "";
}

.logo-plaque::before {
  top: -8px;
  left: -8px;
}

.logo-plaque::after {
  right: -8px;
  bottom: -8px;
}

.logo-gem {
  position: absolute;
  top: -16px;
  left: 50%;
  width: 38px;
  height: 38px;
  border: 5px solid #6f3516;
  background: linear-gradient(135deg, #8ff4ff, #0059ff 58%, #03246c);
  box-shadow:
    0 0 20px rgba(32, 180, 255, 0.72),
    0 12px 20px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%) rotate(45deg);
}

.logo-plaque strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.24rem, 4.8vw, 3.72rem);
  font-weight: 900;
  line-height: 0.82;
  text-shadow:
    0 4px 0 #4d210c,
    0 0 22px rgba(255, 186, 84, 0.35);
}

.logo-plaque small {
  color: #ffc96e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.8rem, 1.05vw, 1rem);
  font-weight: 800;
  text-shadow: 0 2px 0 #4d210c;
}

.logo-plaque em {
  margin-top: 1px;
  color: rgba(255, 238, 201, 0.82);
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.wood-nav {
  z-index: 2;
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 2.6vw, 40px);
  padding: 14px 32px 0 10px;
}

.wood-nav::before {
  top: 13px;
  left: 14px;
}

.wood-nav::after {
  top: 13px;
  right: 2px;
}

.wood-nav button,
.wood-mobile button {
  padding: 5px 4px;
  background: transparent;
  color: #f4e3c5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.35vw, 1.38rem);
  font-weight: 800;
  text-shadow: 0 2px 0 #1b0b05;
  cursor: pointer;
}

.wood-nav button:hover,
.wood-nav button.active,
.wood-mobile button:hover,
.wood-mobile button.active {
  color: var(--cyan);
  text-shadow:
    0 2px 0 #06131c,
    0 0 16px rgba(53, 213, 255, 0.72);
}

.quartermaster-link {
  display: none;
}

.wood-menu {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-top: 28px;
  border: 2px solid #673018;
  border-radius: 7px;
  background: linear-gradient(180deg, #6a3518, #251007);
  color: #ffe4bb;
  box-shadow: inset 0 2px 0 rgba(255, 221, 145, 0.18);
  cursor: pointer;
}

.wood-mobile {
  position: absolute;
  top: 92px;
  right: 16px;
  display: grid;
  min-width: 220px;
  gap: 10px;
  padding: 16px;
  border: 2px solid #5e2b13;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 222, 159, 0.06) 0 2px, transparent 2px 15px),
    linear-gradient(180deg, #522613, #180b05);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.54);
}

@media (max-width: 1040px) {
  .wood-topbar {
    grid-template-columns: minmax(210px, 278px) 1fr auto;
    padding-right: 18px;
  }

  .wood-topbar::before {
    left: 218px;
  }

  .wood-nav {
    gap: 16px;
    padding-right: 18px;
  }
}

@media (max-width: 820px) {
  .wood-topbar {
    min-height: 88px;
    grid-template-columns: 1fr auto;
    padding: 8px 10px 0;
  }

  .wood-topbar::before,
  .wood-topbar::after,
  .wood-nav {
    display: none;
  }

  .logo-plaque {
    width: min(228px, calc(100vw - 72px));
    min-height: 72px;
    padding: 8px 14px 12px;
  }

  .logo-plaque strong {
    font-size: clamp(2.08rem, 10vw, 2.85rem);
  }

  .logo-plaque small {
    font-size: 0.84rem;
  }

  .logo-plaque em {
    font-size: 0.62rem;
  }

  .logo-gem {
    top: -13px;
    width: 32px;
    height: 32px;
    border-width: 4px;
  }

  .wood-menu {
    display: grid;
    margin-top: 20px;
  }

  .quartermaster-link {
    display: inline-block;
  }
}

@media (max-width: 430px) {
  .wood-mobile {
    right: 10px;
    left: 10px;
  }
}

.gemhall-app .wood-topbar {
  min-height: 96px;
  grid-template-columns: minmax(238px, 330px) 1fr auto;
  padding: 14px 28px 0 14px;
}

.gemhall-app .wood-topbar::before {
  top: 21px;
  right: 26px;
  left: 262px;
  height: 58px;
  border: 2px solid #2a0e04;
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 12% 28%, rgba(255, 187, 89, 0.2) 0 6px, rgba(42, 13, 4, 0.62) 7px 16px, transparent 18px),
    radial-gradient(ellipse at 39% 72%, rgba(255, 181, 73, 0.14) 0 5px, rgba(28, 7, 2, 0.62) 6px 14px, transparent 16px),
    radial-gradient(ellipse at 78% 36%, rgba(255, 205, 119, 0.15) 0 7px, rgba(24, 7, 2, 0.58) 8px 19px, transparent 21px),
    repeating-linear-gradient(0deg, rgba(255, 219, 141, 0.14) 0 2px, transparent 2px 12px),
    repeating-linear-gradient(90deg, rgba(12, 4, 1, 0.26) 0 3px, transparent 3px 84px),
    linear-gradient(180deg, #a45b27 0%, #743616 34%, #321207 72%, #0c0301 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 227, 160, 0.3),
    inset 0 -6px 0 rgba(0, 0, 0, 0.58),
    inset 0 0 0 1px rgba(255, 207, 112, 0.16),
    0 15px 28px rgba(0, 0, 0, 0.66);
}

.gemhall-app .wood-topbar::after {
  top: 5px;
  width: 46px;
  height: 66px;
  background:
    radial-gradient(circle at 50% 22%, #b5fbff 0 10px, #0079ff 11px 18px, transparent 19px),
    linear-gradient(180deg, #a75c27, #311307);
}

.gemhall-app .logo-plaque {
  width: min(318px, calc(100vw - 78px));
  min-height: 102px;
  padding: 10px 18px 14px;
  border: 3px solid #2a0e04;
  background:
    radial-gradient(ellipse at 17% 38%, rgba(255, 189, 89, 0.2) 0 7px, rgba(35, 10, 3, 0.66) 8px 19px, transparent 21px),
    radial-gradient(ellipse at 78% 64%, rgba(255, 204, 114, 0.16) 0 7px, rgba(29, 8, 2, 0.62) 8px 20px, transparent 22px),
    repeating-linear-gradient(0deg, rgba(255, 228, 159, 0.16) 0 2px, transparent 2px 13px),
    repeating-linear-gradient(90deg, rgba(15, 5, 1, 0.24) 0 4px, transparent 4px 78px),
    linear-gradient(180deg, #a65b29 0%, #713415 40%, #2b1006 74%, #0b0301 100%);
  box-shadow:
    inset 0 4px 0 rgba(255, 233, 168, 0.32),
    inset 0 -7px 0 rgba(0, 0, 0, 0.52),
    0 16px 32px rgba(0, 0, 0, 0.58);
}

.gemhall-app .logo-plaque strong {
  font-size: clamp(2.9rem, 5.8vw, 4.85rem);
}

.gemhall-app .wood-nav {
  min-height: 52px;
  gap: clamp(12px, 2.35vw, 34px);
  padding-top: 22px;
}

.gemhall-app .wood-menu {
  border-color: #2a0e04;
  background:
    radial-gradient(ellipse at 48% 28%, rgba(255, 202, 115, 0.22), transparent 32%),
    linear-gradient(180deg, #8c481e, #271006);
}

@media (max-width: 820px) {
  .gemhall-app .wood-topbar {
    min-height: 74px;
    padding: 7px 8px 0;
  }

  .gemhall-app .logo-plaque {
    width: min(210px, calc(100vw - 66px));
    min-height: 66px;
    padding: 6px 12px 10px;
  }

  .gemhall-app .logo-plaque strong {
    font-size: clamp(2.05rem, 9.4vw, 2.85rem);
  }

  .gemhall-app .logo-plaque small {
    font-size: 0.78rem;
  }

  .gemhall-app .logo-plaque em {
    font-size: 0.56rem;
  }

  .gemhall-app .wood-menu {
    width: 42px;
    height: 42px;
    margin-top: 15px;
  }
}

/* ===================================================================== */
/* 0.18.0-pixel — 2D Starbound-style tavern                              */
/* ===================================================================== */
.px-app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  font-family: Georgia, "Times New Roman", serif;
  background: #07060c;
  overflow: hidden;
}
.px-app img { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---- top bar ---- */
.px-topbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #2a1608, #140803);
  border-bottom: 4px solid #000;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), inset 0 2px 0 #6b3a1c;
}
.px-logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: none;
  cursor: pointer;
  color: var(--gold);
}
.px-logo-gem {
  width: 14px; height: 14px;
  background: var(--cyan);
  box-shadow: 0 0 0 3px #07334a, 2px 2px 0 #000;
  transform: rotate(45deg);
  align-self: center;
}
.px-logo strong { font-size: 18px; letter-spacing: 1px; color: var(--cream); text-shadow: 2px 2px 0 #000; }
.px-logo small { font-size: 7px; color: #c79a5c; letter-spacing: 1px; }
.px-logo em { font-size: 7px; color: #6f5736; font-style: normal; }
.px-nav { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.px-nav-btn {
  font-family: inherit;
  font-size: 9px;
  padding: 9px 11px;
  color: var(--cream);
  background: #3a2110;
  border: 2px solid #000;
  box-shadow: inset -2px -2px 0 #1c0f06, inset 2px 2px 0 #6b3a1c, 2px 2px 0 #000;
  cursor: pointer;
  letter-spacing: 1px;
}
.px-nav-btn:hover { background: #50300f; color: #fff; }
.px-nav-btn.active { background: var(--gold); color: #2a1303; box-shadow: inset -2px -2px 0 #b07a26, inset 2px 2px 0 #ffe6a8, 2px 2px 0 #000; }
.px-nav-btn.quartermaster { color: var(--cyan); }
.px-nav-btn.quartermaster.active { color: #06222f; background: var(--cyan); }
.px-menu { display: none; margin-left: auto; color: var(--cream); background: #3a2110; border: 2px solid #000; padding: 8px; cursor: pointer; }
.px-mobile { display: none; }

/* ---- stage ---- */
.px-stage { position: relative; flex: 1; overflow: hidden; cursor: crosshair; }
.px-bg {
  position: absolute;
  inset: -6%;
  background-image: url('/scene2d/bg.png');
  background-size: cover;
  background-position: center 38%;
  image-rendering: pixelated;
  filter: saturate(1.05) brightness(0.82) contrast(1.08);
  will-change: transform;
}
.px-bg-haze {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 66% 40%, rgba(255, 159, 56, 0.28), transparent 55%),
    radial-gradient(90% 70% at 30% 55%, rgba(39, 216, 255, 0.16), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.px-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 42%, transparent 42%, rgba(5, 3, 8, 0.85) 100%);
}

/* ---- embers ---- */
.px-embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.px-embers span {
  position: absolute;
  bottom: -10px;
  background: #ffb451;
  box-shadow: 0 0 6px 1px rgba(255, 180, 81, 0.8);
  opacity: 0;
  animation-name: px-rise;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
@keyframes px-rise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  12% { opacity: 0.9; }
  80% { opacity: 0.5; }
  100% { transform: translateY(-78vh) translateX(18px); opacity: 0; }
}

/* ---- floor + characters ---- */
.px-floor {
  position: absolute;
  left: 0; right: 0;
  bottom: 6%;
  height: 0;
  will-change: transform;
}
.px-char {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  background: none;
  cursor: pointer;
  padding: 0;
  filter: drop-shadow(3px 4px 0 rgba(0, 0, 0, 0.55));
  transition: filter 0.15s;
}
.px-char img {
  display: block;
  animation: px-bob var(--bob, 3.6s) ease-in-out infinite;
}
.px-char:hover { filter: drop-shadow(0 0 10px rgba(255, 200, 120, 0.7)) drop-shadow(3px 4px 0 rgba(0, 0, 0, 0.55)); }
.px-char.here img { animation: px-bob var(--bob, 3.6s) ease-in-out infinite, px-glow 1.6s ease-in-out infinite; }
@keyframes px-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes px-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}
.px-char-shadow {
  position: absolute;
  left: 50%; bottom: -6px;
  width: 60%; height: 12px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%);
  pointer-events: none;
}
.px-speech {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 230px;
  padding: 8px 10px;
  font-size: 8px;
  line-height: 1.7;
  color: #1c1206;
  background: var(--cream);
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
  text-align: center;
}
.px-speech strong { color: #7a3d0c; }
.px-speech em { display: block; margin-top: 4px; font-style: normal; color: #3a2a14; }
.px-speech::after {
  content: '';
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #000;
}

/* ---- route board ---- */
.px-board {
  position: absolute;
  top: 50%;
  left: 28px;
  transform: translateY(-50%);
  width: min(340px, 42vw);
  padding: 18px 18px 16px;
  z-index: 20;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(20, 14, 30, 0.95), rgba(10, 7, 16, 0.96));
  border: 3px solid #000;
  box-shadow: inset 0 0 0 2px var(--tint), inset 0 0 24px rgba(0, 0, 0, 0.7), 5px 5px 0 #000;
  animation: px-board-in 0.25s ease-out;
}
@keyframes px-board-in {
  from { opacity: 0; transform: translateY(-50%) translateX(-12px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}
.px-board-rivets {
  position: absolute; inset: 6px; pointer-events: none;
  background-image: radial-gradient(circle, var(--tint) 1.5px, transparent 2px);
  background-position: 0 0, 100% 0, 0 100%, 100% 100%;
  background-size: 8px 8px;
  background-repeat: no-repeat;
  opacity: 0.5;
}
.px-board-tag {
  display: inline-block;
  font-size: 7px;
  letter-spacing: 2px;
  padding: 4px 6px;
  color: #07060c;
  background: var(--tint);
}
.px-board-head h2 { margin: 10px 0 6px; font-size: 14px; color: #fff; text-shadow: 2px 2px 0 #000; line-height: 1.4; }
.px-board-head p { margin: 0 0 12px; font-size: 8px; line-height: 1.8; color: #b9a6cf; }
.px-board-rows { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.px-board-rows li { display: flex; align-items: center; gap: 8px; font-size: 8px; line-height: 1.7; color: var(--cream); }
.px-bullet { flex: none; width: 7px; height: 7px; background: var(--tint); box-shadow: 1px 1px 0 #000; transform: rotate(45deg); }
.px-board-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.px-stat { font-size: 7px; padding: 5px 6px; color: var(--tint); border: 1px solid var(--tint); background: rgba(0, 0, 0, 0.4); }
.px-board-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.px-action {
  font-family: inherit;
  font-size: 7px;
  padding: 7px 8px;
  color: var(--cream);
  background: #2a1c12;
  border: 2px solid #000;
  box-shadow: inset -1px -1px 0 #140b06, inset 1px 1px 0 #4a2f18, 2px 2px 0 #000;
  cursor: pointer;
  letter-spacing: 1px;
}
.px-action:hover { background: var(--tint); color: #07060c; }

/* ---- mobile ---- */
@media (max-width: 760px) {
  .px-nav { display: none; }
  .px-menu { display: inline-flex; }
  .px-mobile-backdrop { position: fixed; inset: 0; background: rgba(8,4,10,0.55); z-index: 49; animation: px-fade .15s ease-out; }
  @keyframes px-fade { from { opacity: 0; } to { opacity: 1; } }
  .px-mobile {
    display: flex; flex-direction: column; gap: 7px;
    position: absolute; top: calc(100% + 4px); right: 8px; left: 8px;
    padding: 10px; background: #160d05; border: 3px solid #000; border-radius: 12px; z-index: 50;
    box-shadow: 0 14px 34px rgba(0,0,0,0.6); animation: px-fade .15s ease-out;
  }
  .px-mobile .px-nav-btn { width: 100%; text-align: center; padding: 12px 10px; font-size: 9px; }
  .px-board { left: 50%; transform: translate(-50%, 0); top: auto; bottom: 12px; width: min(94vw, 420px); }
  @keyframes px-board-in { from { opacity: 0; } to { opacity: 1; } }
  .px-char img { height: auto; }
}

/* ---- auth + admin (0.18 backend wiring) ---- */
.px-nav-user { color: #36f0b0; }
.px-board-wide { width: min(680px, 88vw); left: 50%; transform: translate(-50%, -50%); }
@keyframes px-board-in-wide { from { opacity: 0; } to { opacity: 1; } }

.px-auth { display: flex; flex-direction: column; gap: 10px; }
.px-auth-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.px-auth-tabs button {
  flex: 1; font-family: inherit; font-size: 9px; padding: 8px; cursor: pointer; letter-spacing: 1px;
  color: var(--cream); background: #2a1c12; border: 2px solid #000; box-shadow: inset 1px 1px 0 #4a2f18;
}
.px-auth-tabs button.active { background: var(--tint); color: #07060c; }
.px-field { display: flex; flex-direction: column; gap: 5px; font-size: 7px; color: #b9a6cf; letter-spacing: 1px; }
.px-field input {
  font-family: inherit; font-size: 9px; padding: 9px; color: var(--cream);
  background: #0c0814; border: 2px solid #000; box-shadow: inset 1px 1px 0 #251a3a;
}
.px-field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--tint); }
.px-auth-submit { align-self: stretch; text-align: center; padding: 10px; font-size: 9px; }
.px-auth-err { color: #ff7a7a; font-size: 8px; line-height: 1.6; margin: 0; }
.px-auth-hint { color: #6f5b8c; font-size: 7px; line-height: 1.7; margin: 2px 0 0; }
.px-auth-hi { font-size: 9px; color: var(--cream); line-height: 1.7; margin: 0; }
.px-auth-hi em { color: #36f0b0; font-style: normal; }
.px-auth-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.px-admin { display: flex; flex-direction: column; gap: 10px; }
.px-admin-gate { text-align: center; padding: 12px 0; }
.px-admin-gate h3 { font-size: 12px; color: #ff9f9f; margin: 0 0 8px; }
.px-admin-gate p { font-size: 8px; color: #b9a6cf; margin: 0 0 12px; line-height: 1.7; }
.px-admin-tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.px-admin-tabs button {
  font-family: inherit; font-size: 8px; padding: 7px 9px; cursor: pointer; letter-spacing: 1px;
  color: var(--cream); background: #2a1c12; border: 2px solid #000;
}
.px-admin-tabs button.active { background: var(--tint); color: #07060c; }
.px-admin-who { margin-left: auto; font-size: 7px; color: #36f0b0; }
.px-admin-table { display: flex; flex-direction: column; border: 2px solid #000; background: rgba(0,0,0,0.35); max-height: 38vh; overflow: auto; }
.px-admin-row { display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr) 40px; gap: 6px; align-items: center; padding: 7px 8px; border-bottom: 1px solid #1c1230; font-size: 8px; }
.px-admin-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-admin-head { position: sticky; top: 0; background: #1a1030; color: var(--tint); font-size: 7px; letter-spacing: 1px; z-index: 1; }
.px-admin-row select { font-family: inherit; font-size: 8px; background: #0c0814; color: var(--cream); border: 1px solid #000; padding: 3px; }
.px-admin-acts button { color: #ff7a7a; background: none; cursor: pointer; font-size: 10px; padding: 2px 6px; }
.px-admin-empty { color: #6f5b8c; grid-template-columns: 1fr; }
.px-admin-new { display: flex; gap: 6px; flex-wrap: wrap; }
.px-admin-new input { font-family: inherit; font-size: 8px; padding: 7px; flex: 1 1 90px; min-width: 70px; color: var(--cream); background: #0c0814; border: 2px solid #000; }
/* users table = 4 cols, others vary; set per-tab via attribute fallback */
.px-admin-table .px-admin-row { --cols: 4; }

/* ===================================================================== */
/* Console theme — docs.amerc.ai / pm.amerc.ai (operator tools)          */
/* ===================================================================== */
.cs-app { position: fixed; inset: 0; display: flex; flex-direction: column;
  background: #0a0e17; color: #dce6f5; font-family: Inter, ui-sans-serif, system-ui, sans-serif; --accent: #27d8ff; }
.cs-loading { margin: auto; color: #6c7b96; font-family: ui-monospace, monospace; }
.cs-brand { display: flex; align-items: center; gap: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; color: #fff; }
.cs-brand small { font-family: Inter, sans-serif; font-size: 11px; color: var(--accent); letter-spacing: 1px; }
.cs-gem { width: 12px; height: 12px; background: var(--accent); transform: rotate(45deg); box-shadow: 0 0 0 2px #07273a; }

.cs-top { display: flex; align-items: center; gap: 18px; padding: 12px 18px; background: #0d1320; border-bottom: 1px solid #1b2536; }
.cs-appnav { display: flex; gap: 4px; margin-left: 8px; }
.cs-appnav a { padding: 6px 12px; border-radius: 7px; color: #aab8d0; text-decoration: none; font-size: 13px; }
.cs-appnav a:hover { background: #16203200; background: #162032; color: #fff; }
.cs-appnav a.on { background: var(--accent); color: #061018; font-weight: 600; }
.cs-user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #aab8d0; }
.cs-user button { padding: 6px 12px; border-radius: 7px; background: #1b2536; color: #dce6f5; cursor: pointer; font-size: 12px; }
.cs-main { flex: 1; min-height: 0; overflow: hidden; display: flex; }

/* RPG building-block login frame — matches the amerc tavern look across all sites */
.cs-login-wrap { margin: auto; padding: 20px; }
.cs-login { display: flex; flex-direction: column; gap: 12px; width: 330px; padding: 26px 24px; color: #fff0d7;
  background: linear-gradient(180deg, #2a1608, #160a04); border: 3px solid #000; border-radius: 4px;
  box-shadow: inset 0 0 0 2px #6b3a1c, inset 0 0 26px rgba(0,0,0,0.7), 6px 6px 0 #000, 0 24px 60px rgba(0,0,0,0.6);
  font-family: Georgia, "Times New Roman", serif; }
.cs-login .cs-brand { justify-content: center; margin-bottom: 8px; color: #f7bc5d; }
.cs-login .cs-gem { background: #27d8ff; }
.cs-tabs { display: flex; gap: 6px; }
.cs-tabs button { flex: 1; padding: 9px; font-family: inherit; font-size: 9px; letter-spacing: 1px; color: #fff0d7;
  background: #3a2110; border: 2px solid #000; box-shadow: inset -2px -2px 0 #1c0f06, inset 2px 2px 0 #6b3a1c; cursor: pointer; }
.cs-tabs button.on { background: var(--accent); color: #061018; font-weight: 600; box-shadow: inset -2px -2px 0 rgba(0,0,0,0.3), inset 2px 2px 0 rgba(255,255,255,0.3); }
.cs-login input { font-family: inherit !important; font-size: 10px; padding: 11px; color: #fff; background: #0c0814; border: 2px solid #000; border-radius: 0; box-shadow: inset 1px 1px 0 #251a3a; }
.cs-login .cs-btn, .cs-login .cs-primary { font-family: inherit; font-size: 10px; border-radius: 0; border: 2px solid #000; letter-spacing: 1px;
  box-shadow: inset -2px -2px 0 rgba(0,0,0,0.35), inset 2px 2px 0 rgba(255,255,255,0.18), 2px 2px 0 #000; padding: 11px; }
.cs-login .cs-hint { font-size: 8px; line-height: 1.7; text-align: center; }
.cs-login .cs-err { font-size: 9px; }
.cs-login input, .cs-field input, .nd-folder-input, .nd-bar select, .wb-name, .docs-side-top input, .docs-title-input, .docs-folder-input, .pm-nav + * input { font-family: inherit; }
.cs-login input { padding: 11px; border-radius: 8px; background: #0a0f1a; border: 1px solid #233044; color: #eaf2ff; font-size: 14px; }
.cs-login input:focus, textarea:focus, .nd-text:focus { outline: 2px solid var(--accent); border-color: transparent; }
.cs-err { color: #ff7a8c; font-size: 13px; margin: 0; }
.cs-hint { color: #6c7b96; font-size: 12px; line-height: 1.6; margin: 6px 0; }
.cs-btn { padding: 8px 12px; border-radius: 8px; background: #1b2536; color: #dce6f5; cursor: pointer; font-size: 13px; border: 1px solid #26334a; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.cs-btn:hover { background: #233044; }
.cs-btn:disabled { opacity: 0.45; cursor: default; }
.cs-primary { background: var(--accent); color: #061018; border-color: transparent; font-weight: 600; }
.cs-primary:hover { filter: brightness(1.08); }
.cs-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #8a99b5; margin-bottom: 10px; }
.cs-field input { padding: 9px; border-radius: 7px; background: #0a0f1a; border: 1px solid #233044; color: #eaf2ff; font-size: 13px; }

.cs-modal { position: fixed; inset: 0; background: rgba(4,7,12,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
.cs-modal-box { width: min(560px, 92vw); max-height: 86vh; overflow: auto; background: #0e1422; border: 1px solid #233044; border-radius: 14px; padding: 16px; }
.cs-modal-wide { width: min(880px, 94vw); }
.cs-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cs-modal-head button { background: #1b2536; color: #dce6f5; padding: 4px 10px; border-radius: 6px; cursor: pointer; }

/* docs */
.docs { display: flex; flex: 1; min-height: 0; width: 100%; }
.docs-side { width: 280px; border-right: 1px solid #1b2536; display: flex; flex-direction: column; background: #0c111c; }
.docs-side-top { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid #1b2536; }
.docs-side-top input { flex: 1; padding: 8px; border-radius: 7px; background: #0a0f1a; border: 1px solid #233044; color: #eaf2ff; }
.docs-tree { overflow: auto; padding: 8px; }
/* docs nav: collapsible on mobile, transparent (display:contents) on desktop (0.91) */
.docs-nav-toggle { display: none; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #0c111c; border: none; border-bottom: 1px solid #1b2536; color: #eaf2ff; font-family: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.docs-nav-cur { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-nav-chev { color: #8a78b4; flex: 0 0 auto; font-size: 12px; transition: transform 0.18s; }
.docs-nav-toggle[aria-expanded="true"] .docs-nav-chev { transform: rotate(180deg); }
.docs-side-body { display: contents; }
.docs-folder-name { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #5f6e88; margin: 10px 6px 4px; }
.docs-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; color: #c3d0e6; cursor: pointer; font-size: 13px; }
.docs-item:hover { background: #141d2e; }
.docs-item.on { background: var(--accent); color: #061018; }
.docs-main { flex: 1; min-width: 0; overflow: auto; padding: 26px 32px; }
.docs-empty { color: #5f6e88; margin-top: 40px; text-align: center; }
.docs-head { display: flex; align-items: center; gap: 12px; }
.docs-head h2 { margin: 0; font-size: 24px; }
.docs-title-input { flex: 1; font-size: 22px; padding: 8px; border-radius: 8px; background: #0a0f1a; border: 1px solid #233044; color: #fff; }
.docs-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.docs-folder-input { padding: 7px; border-radius: 7px; background: #0a0f1a; border: 1px solid #233044; color: #eaf2ff; width: 120px; }
.docs-byline { color: #5f6e88; font-size: 12px; margin: 4px 0 18px; }
.docs-editor { width: 100%; min-height: 60vh; padding: 16px; border-radius: 10px; background: #0a0f1a; border: 1px solid #233044; color: #eaf2ff; font-family: ui-monospace, monospace; font-size: 14px; line-height: 1.6; resize: vertical; }
.docs-render { line-height: 1.7; font-size: 15px; max-width: 760px; }
.docs-render h1, .docs-render h2, .docs-render h3 { color: #fff; margin-top: 1.4em; }
.docs-render a { color: var(--accent); }
.docs-render code { background: #16203200; background: #162032; padding: 2px 6px; border-radius: 5px; font-size: 0.9em; }
.docs-render pre { background: #0a0f1a; padding: 14px; border-radius: 10px; overflow: auto; border: 1px solid #1b2536; }
.docs-render blockquote { border-left: 3px solid var(--accent); margin: 0; padding-left: 14px; color: #aab8d0; }
.docs-render table { border-collapse: collapse; } .docs-render td, .docs-render th { border: 1px solid #233044; padding: 6px 10px; }

/* pm */
.pm { display: flex; flex: 1; min-height: 0; width: 100%; }
.pm-nav { width: 180px; border-right: 1px solid #1b2536; padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; background: #0c111c; }
.pm-nav button { text-align: left; padding: 10px 12px; border-radius: 8px; color: #c3d0e6; cursor: pointer; font-size: 14px; }
.pm-nav button:hover { background: #141d2e; }
.pm-nav button.on { background: var(--accent); color: #061018; font-weight: 600; }
.pm-nav-ext { margin-top: auto; padding: 10px 12px; color: #8a99b5; font-size: 13px; text-decoration: none; }
.pm-body { flex: 1; min-width: 0; overflow: auto; padding: 22px 26px; display: flex; flex-direction: column; }
.pm-cards-head, .pm-disk h2, .pm-portfolio h2 { display: flex; align-items: center; gap: 12px; }
.pm-cards-head { justify-content: space-between; }
.pm-cards-head h2 { margin: 0; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.pm-card { position: relative; padding: 16px; border-radius: 12px; background: #0e1422; border: 1px solid #1f2a3d; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.pm-card:hover { border-color: var(--accent); }
.pm-card-ico { font-size: 28px; } .pm-card strong { font-size: 15px; } .pm-card span { font-size: 12px; color: var(--accent); } .pm-card small { font-size: 11px; color: #5f6e88; }
.pm-card-del { position: absolute; top: 8px; right: 8px; background: #1b2536; color: #ff8c9c; border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.pm-portfolio h2 { margin-top: 0; } .pm-port-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 12px; }
.pm-port-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #1b2536; font-size: 14px; } .pm-port-row span { color: #8a99b5; } .pm-port-row em { margin-left: auto; font-style: normal; color: #aab8d0; }
.risk-green { color: #36f0b0 !important; } .risk-amber { color: #f2b85f !important; } .risk-red { color: #ff7a8c !important; }
.pm-disk { flex: 1; display: flex; flex-direction: column; min-height: 0; } .pm-disk h2 { margin: 0 0 12px; }

/* netdisk */
.nd { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.nd-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.nd-bar select, .nd-folder-input { padding: 8px; border-radius: 7px; background: #0a0f1a; border: 1px solid #233044; color: #eaf2ff; }
.nd-grid { display: flex; gap: 16px; flex: 1; min-height: 0; }
.nd-compact .nd-grid { display: block; }
.nd-list { width: 100%; max-width: 420px; overflow: auto; border: 1px solid #1b2536; border-radius: 10px; }
.nd-compact .nd-list { max-width: none; max-height: 50vh; }
.nd-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #141d2e; cursor: pointer; font-size: 13px; }
.nd-row:hover { background: #111a29; } .nd-row.on { background: #14223a; }
.nd-icon { font-size: 16px; } .nd-name { font-weight: 500; } .nd-meta { margin-left: auto; color: #5f6e88; font-size: 11px; }
.nd-pick { padding: 3px 8px !important; font-size: 11px !important; }
.nd-del { background: none; color: #6c7b96; cursor: pointer; padding: 2px 6px; } .nd-del:hover { color: #ff8c9c; }
.nd-empty, .docs-empty { color: #5f6e88; padding: 20px; text-align: center; font-size: 13px; }
.nd-preview { flex: 1; min-width: 0; border: 1px solid #1b2536; border-radius: 10px; padding: 14px; overflow: auto; }
.nd-preview-empty { color: #5f6e88; display: flex; align-items: center; justify-content: center; }
.nd-preview-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .nd-preview-head span { color: #5f6e88; font-size: 12px; margin-right: auto; }
.nd-img { max-width: 100%; image-rendering: auto; border-radius: 8px; }
.nd-text { width: 100%; min-height: 50vh; background: #0a0f1a; border: 1px solid #233044; border-radius: 8px; color: #eaf2ff; padding: 12px; font-family: ui-monospace, monospace; }
.nd-textview { white-space: pre-wrap; background: #0a0f1a; padding: 12px; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 13px; }
.nd-binary { color: #8a99b5; } .nd-binary a, .nd-textview a { color: var(--accent); }

/* whiteboard */
.wb { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
.wb-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #1b2536; flex-wrap: wrap; }
.wb-name { font-size: 16px; font-weight: 600; padding: 6px 10px; border-radius: 7px; background: #0a0f1a; border: 1px solid #233044; color: #fff; }
.wb-hint { color: #5f6e88; font-size: 12px; }
.wb-saved { color: #36f0b0; font-size: 12px; margin-left: auto; }
.wb-body { flex: 1; display: flex; min-height: 0; }
.wb-canvas-wrap { flex: 1; overflow: auto; background: #0a0e17 radial-gradient(circle, #131c2c 1px, transparent 1px); background-size: 26px 26px; }
.wb-canvas { display: block; background: transparent; }
.wb-side { width: 250px; border-left: 1px solid #1b2536; padding: 16px; background: #0c111c; overflow: auto; }
.wb-side h4 { margin: 0 0 12px; }
.wb-colors { display: flex; gap: 6px; } .wb-colors button { width: 22px; height: 22px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; } .wb-colors button.on { border-color: #fff; }
.wb-link { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-size: 13px; color: #aab8d0; }

@media (max-width: 720px) {
  .docs-side, .pm-nav { width: 150px; }
  .nd-grid { flex-direction: column; } .nd-list { max-width: none; }
  .cs-appnav { display: none; }
}

/* ===================================================================== */
/* 0.21 — top-down RPG tavern + agent platform                           */
/* ===================================================================== */
.td-app { background: #0a0710; }
.td-home { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 18px; overflow: hidden; }
.td-stage { position: relative; aspect-ratio: 1200 / 760; width: min(96vw, calc((100vh - 150px) * 1.579)); border-radius: 8px; overflow: hidden; box-shadow: 0 18px 60px rgba(0,0,0,0.7), inset 0 0 0 4px #1a0f08, inset 0 0 0 6px #3a2410; }
.td-room { position: absolute; inset: 0; }
.td-canvas { width: 100%; height: 100%; display: block; image-rendering: auto; }
.td-overlay { position: absolute; inset: 0; }

.td-npc { position: absolute; transform: translateX(-50%); bottom: auto; background: none; cursor: pointer; padding: 0; filter: drop-shadow(0 6px 6px rgba(0,0,0,0.55)); }
.td-npc img { height: 100%; display: block; animation: td-bob 4s ease-in-out infinite; }
.td-npc:hover { filter: drop-shadow(0 0 12px rgba(255,200,120,0.85)) drop-shadow(0 6px 6px rgba(0,0,0,0.55)); z-index: 5; }
@keyframes td-bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4%)} }
.td-npc-shadow { position: absolute; left: 50%; bottom: -4px; width: 60%; height: 8%; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(0,0,0,0.5), transparent 70%); }
.td-say { position: absolute; bottom: 102%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 180px; padding: 6px 8px; font-size: 8px; line-height: 1.6; color: #1c1206; background: var(--cream); border: 2px solid #000; box-shadow: 2px 2px 0 #000; text-align: center; z-index: 6; }
.td-say strong { color: #7a3d0c; } .td-say em { display: block; font-style: normal; color: #3a2a14; margin-top: 2px; }

.td-hot { position: absolute; transform: translate(-50%, -50%); font-family: Georgia, "Times New Roman", serif; cursor: pointer; z-index: 4; }
.td-hot-board { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 8px 14px; color: #cdeaff; background: rgba(8,20,36,0.82); border: 2px solid #27d8ff; box-shadow: 0 0 18px rgba(39,216,255,0.4), 3px 3px 0 #000; font-size: 11px; }
.td-hot-board .td-hot-tag { font-size: 6px; letter-spacing: 2px; color: #27d8ff; }
.td-hot-board:hover { background: rgba(12,30,52,0.92); }
.td-hot-door { padding: 8px 14px; font-size: 10px; color: #36f0b0; background: rgba(8,24,18,0.82); border: 2px solid #36f0b0; box-shadow: 0 0 16px rgba(54,240,176,0.35), 3px 3px 0 #000; }
.td-hot-door:hover { background: rgba(12,34,26,0.92); }

.td-hero { position: absolute; left: 2.5%; top: 6%; width: min(40%, 380px); z-index: 4; font-family: Georgia, "Times New Roman", serif;
  padding: 16px 18px; background: linear-gradient(180deg, rgba(12,6,18,0.72), rgba(12,6,18,0.45)); border-radius: 10px; backdrop-filter: blur(2px); }
.td-hero h1 { font-size: clamp(13px, 2.1vw, 22px); line-height: 1.5; color: #fff; text-shadow: 2px 2px 0 #000, 0 0 18px rgba(0,0,0,0.8); margin: 0 0 10px; }
.td-hero p { font-family: Inter, sans-serif; font-size: clamp(10px, 1.3vw, 13px); line-height: 1.7; color: #e7d4b6; text-shadow: 1px 1px 2px #000; margin: 0 0 12px; }
.td-hero-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.td-stats { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 4; }
.td-stat { display: flex; flex-direction: column; align-items: center; padding: 6px 10px; background: rgba(8,12,22,0.8); border: 2px solid #000; box-shadow: 2px 2px 0 #000; font-family: Georgia, "Times New Roman", serif; }
.td-stat b { font-size: 14px; color: #27d8ff; } .td-stat span { font-size: 6px; color: #9fb0d0; margin-top: 3px; letter-spacing: 1px; }

.td-page { flex: 1; overflow: auto; background: #0a0710 radial-gradient(circle at 50% -10%, #1a0f22, #0a0710 60%); }
.td-signin { padding: 40px 16px; } .td-app .td-page .px-board { color: var(--cream); }

/* agent platform */
.ap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; color: #e7d4b6; font-family: Inter, sans-serif; }
.ap-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ap-head h2 { font-family: Georgia, "Times New Roman", serif; font-size: 18px; color: #fff; margin: 0; }
.ap-by { color: #9a86b8; font-size: 13px; }
.ap-search { margin-left: auto; padding: 9px 12px; border-radius: 8px; background: #140d1e; border: 1px solid #2e2440; color: #eaf2ff; font-family: inherit; }
.ap-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.ap-tag { padding: 6px 10px; border-radius: 16px; background: #181226; border: 1px solid #2e2440; color: #c9b8e6; cursor: pointer; font-size: 12px; }
.ap-tag.on { background: #27d8ff; color: #061018; border-color: transparent; font-weight: 600; }
.ap-tag em { opacity: 0.6; font-style: normal; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ap-card { text-align: left; padding: 16px; border-radius: 12px; background: #130d20; border: 1px solid #271c3a; cursor: pointer; display: flex; flex-direction: column; gap: 8px; color: inherit; }
.ap-card:hover { border-color: #27d8ff; transform: translateY(-2px); transition: 0.12s; }
.ap-card-top { display: flex; align-items: center; gap: 8px; } .ap-card-top strong { font-size: 15px; color: #fff; }
.ap-kind { font-size: 10px; padding: 2px 7px; border-radius: 5px; background: #271c3a; color: #c9b8e6; }
.ap-desc { font-size: 13px; color: #b9a6cf; margin: 0; line-height: 1.6; }
.ap-card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.ap-card-tags span { font-size: 10px; padding: 2px 7px; border-radius: 10px; background: #1d1530; color: #9d8fc0; }
.ap-card-foot { display: flex; justify-content: space-between; font-size: 11px; color: #8a7aa8; margin-top: auto; }
.ap-online { display: flex; align-items: center; gap: 5px; } .ap-online i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ap-hint { color: #8a7aa8; font-size: 12px; line-height: 1.6; }
.ap-h4 { font-family: Georgia, "Times New Roman", serif; font-size: 10px; color: #27d8ff; margin: 16px 0 8px; }

.ap-modal { position: fixed; inset: 0; background: rgba(4,6,14,0.75); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.ap-modal-box { width: min(640px, 96vw); max-height: 88vh; overflow: auto; background: #120c1e; border: 2px solid #2e2440; border-radius: 14px; padding: 18px; }
.ap-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.ap-modal-head h3 { margin: 0; color: #fff; } .ap-modal-head button { background: #271c3a; color: #ddd; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.ap-sub { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.ap-token { font-family: ui-monospace, monospace; font-size: 12px; padding: 6px 9px; background: #0a0f1a; border: 1px solid #2e2440; border-radius: 7px; color: #36f0b0; cursor: pointer; word-break: break-all; }
.ap-inst-list { display: flex; flex-direction: column; gap: 8px; }
.ap-inst { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #0e0a18; border: 1px solid #241a36; border-radius: 9px; font-size: 13px; }
.ap-inst-status { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ap-inst-name { font-weight: 600; color: #eee; } .ap-inst-meta { color: #8a7aa8; font-size: 11px; margin-left: auto; margin-right: 8px; }
.ap-use { margin-top: 14px; border: 1px solid #2e2440; border-radius: 10px; overflow: hidden; }
.ap-use-head { display: flex; justify-content: space-between; align-items: center; background: #0e0a18; padding: 6px 8px; }
.ap-use-tabs button { padding: 6px 10px; border-radius: 6px; background: #1d1530; color: #c9b8e6; cursor: pointer; font-size: 12px; margin-right: 4px; }
.ap-use-tabs button.on { background: #27d8ff; color: #061018; }
.ap-use-x { background: none; color: #8a7aa8; cursor: pointer; font-size: 12px; }
.ap-use-start { padding: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.ap-use-start input { padding: 8px; border-radius: 7px; background: #0a0f1a; border: 1px solid #2e2440; color: #eaf2ff; flex: 1; }
.ap-iframe { width: 100%; height: 440px; border: 0; background: #fff; display: block; }
.ap-embed { padding: 10px; background: #0a0f1a; font-size: 12px; } .ap-embed code { color: #36f0b0; font-family: ui-monospace, monospace; word-break: break-all; }
.ap-gate { text-align: center; padding-top: 40px; }
.ap-booth-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.ap-publish { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #130d20; border: 1px solid #271c3a; border-radius: 12px; }
.ap-publish input, .ap-publish textarea, .ap-publish select { padding: 9px; border-radius: 7px; background: #0a0f1a; border: 1px solid #2e2440; color: #eaf2ff; font-family: inherit; font-size: 13px; }
.ap-publish textarea { min-height: 60px; resize: vertical; } .ap-row { display: flex; gap: 8px; } .ap-row > * { flex: 1; }
.ap-mine-class, .ap-mine-inst { padding: 10px 12px; background: #0e0a18; border: 1px solid #241a36; border-radius: 9px; margin-bottom: 8px; }
.ap-mine-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; } .ap-mine-row strong { color: #fff; } .ap-mine-row span { color: #8a7aa8; font-size: 12px; }
.ap-mine-inst { display: flex; align-items: center; gap: 10px; font-size: 13px; } .ap-mine-inst em { font-style: normal; color: #c9b8e6; }
.ap-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #9a86b8; margin: 8px 0; }
@media (max-width: 760px) {
  .td-hero { position: static; width: auto; padding: 12px; }
  .td-stage { width: 96vw; } .td-stats { position: static; transform: none; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
  .td-home { flex-direction: column; } .ap-booth-grid { grid-template-columns: 1fr; }
}

/* ===================================================================== */
/* 0.23 — concept-art hero frontpage (interactive layers)                */
/* ===================================================================== */
.hero-wrap { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #14100c, #000); overflow: hidden; }
.hero-stage { position: relative; width: min(100vw, calc((100vh - 0px) * 1.777)); aspect-ratio: 1672 / 941; box-shadow: 0 0 80px rgba(0,0,0,0.8); }
.hero-img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hero-hot { position: absolute; background: transparent; border: 0; padding: 0; cursor: pointer; border-radius: 10px; transition: box-shadow .14s ease, background .14s ease; }
.hero-hot:hover { background: rgba(70,200,255,0.10); box-shadow: 0 0 0 2px rgba(80,205,255,0.55), 0 0 26px rgba(70,200,255,0.45); }
.hero-glow:hover { background: rgba(70,200,255,0.07); box-shadow: 0 0 34px rgba(70,200,255,0.4); }
.hero-live { position: absolute; left: 2.5%; bottom: 3.5%; display: flex; gap: 10px; font-family: Georgia, serif; }
.hero-live span { font-size: clamp(10px, 1.05vw, 14px); color: #cfe0ff; background: rgba(8,16,30,0.66); border: 1px solid rgba(80,200,255,0.35); border-radius: 8px; padding: 6px 11px; backdrop-filter: blur(2px); }
.hero-live b { color: #5fe0ff; font-size: 1.18em; }
.hero-acct { position: absolute; right: 2.5%; bottom: 3.5%; font-family: Georgia, serif; font-size: clamp(10px, 1vw, 13px); color: #dfe8ff; background: rgba(8,16,30,0.66); border: 1px solid rgba(120,150,200,0.35); border-radius: 8px; padding: 6px 11px; }
.hero-acct button { color: #5fe0ff; background: none; cursor: pointer; font-family: inherit; font-size: inherit; text-decoration: underline; }
@media (max-width: 640px) { .hero-live span:nth-child(3) { display: none; } }

/* ===================================================================== */
/* 0.24 — 2D RPG game tavern (Kenney Tiny Dungeon CC0 tiles)             */
/* ===================================================================== */
.gm-home { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; background: radial-gradient(circle at 50% 30%, #16100e, #070506); overflow: hidden; }
.gm-stage { position: relative; aspect-ratio: 512 / 352; width: min(94vw, calc((100vh - 290px) * 1.4545)); box-shadow: 0 14px 44px rgba(0,0,0,0.75), 0 0 0 3px #2a1a10, 0 0 0 7px #120a06, 0 0 0 9px #000; }
.gm-room { position: absolute; inset: 0; }
.gm-canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.gm-overlay { position: absolute; inset: 0; }
.gm-hot { position: absolute; background: transparent; border: 0; padding: 0; cursor: pointer; border-radius: 6px; transition: box-shadow .15s ease, background .15s ease; }
.gm-hot:hover { background: rgba(70,200,255,0.12); box-shadow: 0 0 0 2px rgba(80,205,255,0.55), 0 0 22px rgba(70,200,255,0.4); }
.gm-label { position: absolute; transform: translateX(-50%); font-family: Georgia, "Times New Roman", serif; font-size: clamp(10px, 1.25vw, 15px); color: #cfeaff; background: rgba(10,20,34,0.84); border: 1px solid rgba(80,200,255,0.45); border-radius: 7px; padding: 5px 12px; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 9px rgba(0,0,0,0.55); }
.gm-label:hover { background: rgba(16,34,54,0.96); color: #fff; transform: translateX(-50%) translateY(-1px); }
.gm-label-booth { color: #7af0b8; border-color: rgba(80,240,180,0.5); }
.gm-label-bar { color: #f0c070; border-color: rgba(240,190,90,0.45); }
.gm-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9a86b8; font-family: Georgia, serif; }
.gm-caption { text-align: center; font-family: Georgia, "Times New Roman", serif; max-width: 760px; padding: 0 12px; }
.gm-caption h1 { font-size: clamp(18px, 2.6vw, 30px); color: #f3d27a; margin: 0 0 4px; text-shadow: 0 2px 7px #000; letter-spacing: 0.5px; }
.gm-caption p { font-size: clamp(11px, 1.3vw, 14px); color: #d8c4a0; margin: 0 0 8px; line-height: 1.5; }
.gm-caption .hero-live { position: static; justify-content: center; }

/* hover visibility boost (0.24.1) */
.gm-hot:hover { background: rgba(80,210,255,0.22) !important; box-shadow: 0 0 0 3px rgba(120,225,255,0.9), 0 0 28px rgba(80,210,255,0.7) !important; }
.gm-label { font-weight: 700; }
.gm-label:hover { background: #1a3a5e !important; color: #fff !important; box-shadow: 0 0 0 2px #7fe3ff, 0 0 18px rgba(80,210,255,0.6) !important; }
.px-nav-btn:hover, .px-action:hover, .ap-card:hover, .cs-btn:hover, .ap-tag:hover {
  outline: 2px solid #7fe3ff; outline-offset: 1px; filter: brightness(1.18);
}
.hero-hot:hover { background: rgba(80,210,255,0.2) !important; box-shadow: 0 0 0 3px rgba(120,225,255,0.85), 0 0 26px rgba(80,210,255,0.6) !important; }

/* mansion — services hall (0.41 vividness) */
.mn-hero { display: flex; gap: 18px; align-items: center; padding: 22px 24px; margin-bottom: 22px; border-radius: 16px;
  background: radial-gradient(120% 160% at 0% 0%, #2a1a3e 0%, #160d22 60%), #160d22;
  border: 1px solid #34254e; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 30px rgba(0,0,0,0.35); position: relative; overflow: hidden; }
.mn-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(39,216,255,0.16), transparent 70%); pointer-events: none; }
.mn-hero-emblem { font-size: 46px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); line-height: 1; }
.mn-hero-body h2 { margin: 0 0 6px; color: #fff; font-size: 24px; }
.mn-hero-body p { margin: 0 0 12px; color: #b6a7d4; font-size: 13.5px; line-height: 1.65; max-width: 70ch; }
.mn-hero-you { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #8fe9c8; font-weight: 600; }
.mn-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #36f0b0; box-shadow: 0 0 0 0 rgba(54,240,176,0.6); animation: mnpulse 2s infinite; }
@keyframes mnpulse { 0% { box-shadow: 0 0 0 0 rgba(54,240,176,0.5); } 70% { box-shadow: 0 0 0 7px rgba(54,240,176,0); } 100% { box-shadow: 0 0 0 0 rgba(54,240,176,0); } }

.mn-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.mn-room { padding: 18px; border-radius: 14px; background: linear-gradient(180deg, #160f24, #120c1d); border: 1px solid #2a1f3e;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s; }
.mn-room.live { grid-column: 1 / -1; border-color: #2f5e6e; box-shadow: 0 0 0 1px rgba(39,216,255,0.08), 0 8px 24px rgba(0,0,0,0.3); }
.mn-room.live:hover { border-color: #46c8e0; box-shadow: 0 0 0 1px rgba(39,216,255,0.18), 0 10px 30px rgba(0,0,0,0.4); }
.mn-room.soon { opacity: 0.92; }
.mn-room.soon:hover { transform: translateY(-2px); border-color: #3a2c54; }
.mn-room-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.mn-room-ico { font-size: 28px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }
.mn-room-titles { display: flex; flex-direction: column; }
.mn-room-titles strong { font-size: 17px; color: #fff; }
.mn-room-tag { font-size: 11px; color: #9a8ac0; letter-spacing: 0.4px; }
.mn-badge { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: 0.8px; padding: 4px 9px; border-radius: 999px; }
.mn-badge.live { color: #06222f; background: linear-gradient(180deg, #5fe6ff, #27d8ff); box-shadow: 0 0 12px rgba(39,216,255,0.4); }
.mn-badge.soon { color: #c9b8e6; background: #241a36; border: 1px solid #3a2c54; }
.mn-room-desc { color: #b0a2cd; font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.mn-feats { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mn-feats li { font-size: 11.5px; color: #cfe6ff; background: rgba(39,216,255,0.08); border: 1px solid rgba(39,216,255,0.18); padding: 3px 9px; border-radius: 999px; }
.mn-room.soon .mn-feats li { color: #c4b6e2; background: rgba(150,120,200,0.08); border-color: rgba(150,120,200,0.18); }
.mn-room-foot { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: #8576a6; text-transform: uppercase; letter-spacing: 0.6px; }
.mn-soon-bar { flex: 0 0 80px; height: 4px; border-radius: 3px; background: #241a36; overflow: hidden; position: relative; }
.mn-soon-bar i { position: absolute; left: -40%; width: 40%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, transparent, #6f5aa0, transparent); animation: mnslide 1.8s infinite; }
@keyframes mnslide { 0% { left: -40%; } 100% { left: 100%; } }
.mn-room-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.mn-url-preview { font-family: ui-monospace, monospace; font-size: 13px; color: #6f7e98; background: #0a0f1a; border: 1px dashed #2e2440; padding: 8px 12px; border-radius: 8px; }
.mn-url-preview span { color: #27d8ff; }
.mn-mine { margin-top: 14px; }
.mn-reg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.mn-reg input { padding: 9px 11px; border-radius: 8px; background: #0a0f1a; border: 1px solid #2e2440; color: #eaf2ff; font-family: inherit; width: 130px; }
.mn-prefix, .mn-suffix { color: #8a7aa8; font-size: 13px; }
.mn-created { background: #0e0a18; border: 1px solid #241a36; border-radius: 10px; padding: 12px; margin: 10px 0; }
.mn-created p { margin: 0 0 8px; font-size: 13px; color: #d8c4a0; } .mn-created code { background: #07060c; padding: 1px 5px; border-radius: 4px; color: #7fe9ff; }
.mn-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #241a36; font-size: 13px; }
.mn-row a { color: #27d8ff; } .mn-row span { color: #8a7aa8; margin-left: auto; }

/* agent card avatars + online pulse + onboarding (0.27 vividness) */
.ap-card-head2 { display: flex; align-items: center; gap: 11px; }
.ap-avatar { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; box-shadow: 0 3px 10px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.12); }
.ap-card-titles { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-card-titles strong { font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-online i.pulse { box-shadow: 0 0 0 0 rgba(54,240,176,0.7); animation: ap-pulse 1.8s infinite; }
@keyframes ap-pulse { 0% { box-shadow: 0 0 0 0 rgba(54,240,176,0.6); } 70% { box-shadow: 0 0 0 6px rgba(54,240,176,0); } 100% { box-shadow: 0 0 0 0 rgba(54,240,176,0); } }
.ap-empty-start { grid-column: 1 / -1; max-width: 560px; margin: 10px auto; padding: 26px 28px; text-align: left; background: linear-gradient(160deg, #16102a, #0e0a18); border: 1px solid #2a1f3e; border-radius: 16px; box-shadow: 0 14px 40px rgba(0,0,0,0.5); }
.ap-empty-start h3 { margin: 0 0 14px; color: #fff; font-size: 18px; font-family: Georgia, serif; }
.ap-empty-start ol { margin: 0 0 18px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.ap-empty-start li { color: #c9b8e6; font-size: 13px; line-height: 1.6; }
.ap-empty-start code { background: #07060c; color: #7fe9ff; padding: 1px 6px; border-radius: 4px; }
.ap-link { background: none; color: #27d8ff; cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }

/* self-service agent keys (booth) */
.ap-keys { margin-top: 22px; padding: 18px; border-radius: 14px; background: #130d20; border: 1px solid #271c3a; }
.ap-keys-mint { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.ap-keys-mint input { flex: 1 1 200px; padding: 9px 11px; border-radius: 8px; background: #0a0f1a; border: 1px solid #2e2440; color: #eaf2ff; font-family: inherit; }

/* footer + live status (0.29) */
.td-page { display: flex; flex-direction: column; }
.td-page-inner { flex: 1; }
.ft { border-top: 1px solid #1c1430; background: linear-gradient(180deg, #0c0814, #07060c); padding: 30px 24px 18px; font-family: Inter, sans-serif; color: #b9a6cf; }
.ft-cols { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.ft-brand { max-width: 340px; }
.ft-logo { display: flex; align-items: center; gap: 8px; }
.ft-logo strong { font-family: Georgia, serif; font-size: 20px; color: #f3d27a; }
.ft-brand p { font-size: 12px; line-height: 1.7; color: #9a86b8; margin: 8px 0 12px; }
.ft-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #8fe9c0; background: rgba(54,240,176,0.08); border: 1px solid rgba(54,240,176,0.3); border-radius: 16px; padding: 5px 12px; }
.ft-status i { width: 8px; height: 8px; border-radius: 50%; background: #36f0b0; box-shadow: 0 0 0 0 rgba(54,240,176,0.7); animation: ap-pulse 1.8s infinite; }
.ft-status.down { color: #ff9f9f; background: rgba(255,122,140,0.08); border-color: rgba(255,122,140,0.3); } .ft-status.down i { background: #ff7a8c; animation: none; }
.ft-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #6f5b8c; margin: 0 0 10px; }
.ft-col a, .ft-col button { display: block; color: #c3d0e6; font-size: 13px; text-decoration: none; background: none; cursor: pointer; padding: 4px 0; text-align: left; font-family: inherit; }
.ft-col a:hover, .ft-col button:hover { color: #27d8ff; }
.ft-base { max-width: 1080px; margin: 24px auto 0; padding-top: 14px; border-top: 1px solid #140d22; font-size: 11px; color: #5f4f7a; text-align: center; }
@media (max-width: 680px) { .ft-cols { grid-template-columns: 1fr 1fr; } .ft-brand { grid-column: 1 / -1; } }

/* 0.30 — landing: scrollable home with "how it works" */
.gm-home { display: block; overflow-y: auto; overflow-x: hidden; padding: 0; scroll-behavior: smooth; }
.gm-hero { min-height: calc(100vh - 58px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px 12px; }
.gm-scrollcue { margin-top: 8px; font-family: Georgia, serif; font-size: 12px; color: #b8a8d8; cursor: pointer; animation: hf-bob 2.2s ease-in-out infinite; }
.gm-scrollcue:hover { color: #27d8ff; }
@keyframes hf-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.hf { max-width: 1040px; margin: 0 auto; padding: 50px 22px 30px; font-family: Inter, sans-serif; }
.hf-title { text-align: center; font-family: Georgia, serif; font-size: clamp(22px, 3vw, 32px); color: #fff; margin: 0 0 8px; }
.hf-title span { color: #f3d27a; }
.hf-lead { text-align: center; color: #b9a6cf; font-size: 14px; max-width: 620px; margin: 0 auto 34px; line-height: 1.7; }
.hf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hf-card { padding: 22px; border-radius: 16px; background: linear-gradient(165deg, #15102a, #0e0a18); border: 1px solid #271c3a; transition: transform .14s, border-color .14s; }
.hf-card:hover { transform: translateY(-4px); border-color: #5a3fa0; }
.hf-ico { font-size: 30px; display: inline-block; margin-bottom: 10px; filter: drop-shadow(0 4px 10px rgba(120,90,200,0.4)); }
.hf-card h3 { margin: 0 0 8px; color: #fff; font-size: 17px; }
.hf-card p { margin: 0 0 14px; color: #b9a6cf; font-size: 13px; line-height: 1.6; }
.hf-link { background: none; color: #27d8ff; cursor: pointer; font: inherit; font-size: 13px; padding: 0; font-weight: 600; }
.hf-link:hover { color: #7fe9ff; }
.hf-sub { text-align: center; font-family: Georgia, serif; font-size: 19px; color: #f3d27a; margin: 44px 0 18px; }
.hf-uses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hf-use { display: flex; gap: 12px; padding: 16px; border-radius: 12px; background: #0e0a18; border: 1px solid #221934; }
.hf-ico-sm { font-size: 22px; flex: none; }
.hf-use strong { color: #fff; font-size: 14px; } .hf-use p { margin: 4px 0 0; color: #9a86b8; font-size: 12px; line-height: 1.5; }
.hf-cta { display: flex; gap: 12px; justify-content: center; margin: 38px 0 0; }
@media (max-width: 760px) { .hf-grid, .hf-uses { grid-template-columns: 1fr; } }

/* live activity feed (0.31) */
.hf-activity { max-width: 640px; margin: 0 auto; }
.act-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.act-list li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; background: #0e0a18; border: 1px solid #1d1430; animation: act-in .4s ease; }
.act-list li:hover { border-color: #2e2440; }
@keyframes act-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.act-ico { font-size: 16px; flex: none; }
.act-text { font-size: 13px; color: #c9b8e6; flex: 1; }
.act-time { font-size: 11px; color: #6f5b8c; flex: none; }

/* toasts (0.32) */
#amerc-toasts { position: fixed; bottom: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.amerc-toast { background: #142238; color: #eaf2ff; border: 1px solid #2e4a6e; border-left: 3px solid #36f0b0; border-radius: 9px; padding: 11px 16px; font-family: Inter, sans-serif; font-size: 13px; box-shadow: 0 10px 28px rgba(0,0,0,0.55); opacity: 0; transform: translateX(24px); transition: opacity .25s ease, transform .25s ease; max-width: 320px; }
.amerc-toast.in { opacity: 1; transform: none; }
.amerc-toast.t-err { border-left-color: #ff7a8c; }

/* booth + modal vividness (0.33) */
.ap-modal-title { display: flex; align-items: center; gap: 12px; }
.ap-avatar-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 15px; }
.ap-inst-status.pulse { box-shadow: 0 0 0 0 rgba(54,240,176,0.7); animation: ap-pulse 1.8s infinite; }
.ap-mine-class { display: flex; flex-direction: column; gap: 6px; }
.ap-mine-row .ap-avatar-sm { flex: none; }

/* account / settings (0.35) */
.acct-grid { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; margin-bottom: 6px; }
.acct-card { padding: 20px; border-radius: 14px; background: #130d20; border: 1px solid #271c3a; }
.acct-profile { text-align: center; }
.acct-avatar { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; font-weight: 700; color: #fff; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-family: Georgia, serif; }
.acct-profile h3 { margin: 0; color: #fff; font-size: 18px; }
.acct-email { color: #9a86b8; font-size: 13px; margin: 4px 0 10px; word-break: break-all; }
.acct-role { display: inline-block; font-size: 11px; padding: 3px 11px; border-radius: 12px; text-transform: uppercase; letter-spacing: 1px; }
.acct-role-admin { background: rgba(242,184,95,0.15); color: #f2b85f; border: 1px solid rgba(242,184,95,0.4); }
.acct-role-member { background: rgba(70,200,224,0.12); color: #46c8e0; border: 1px solid rgba(70,200,224,0.3); }
.acct-links { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.acct-form { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.acct-form input { padding: 10px; border-radius: 8px; background: #0a0f1a; border: 1px solid #2e2440; color: #eaf2ff; font-family: inherit; }
@media (max-width: 680px) { .acct-grid { grid-template-columns: 1fr; } }

/* agent-use embed prominence (0.37) */
.ap-embed { padding: 14px; background: #0a0f1a; border-top: 1px solid #1d1430; }
.ap-embed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; font-size: 13px; color: #c9b8e6; }
.ap-embed > code { display: block; color: #7fe9ff; font-family: ui-monospace, monospace; font-size: 12px; background: #07060c; padding: 10px 12px; border-radius: 8px; word-break: break-all; border: 1px solid #1d2a3a; }
.ap-embed .ap-hint { margin: 8px 0 0; } .ap-embed .ap-hint code { display: inline; padding: 1px 5px; background: #162032; color: #9d8fc0; }
.ap-pty-note { padding: 12px 14px; }

/* tavern NPC speech bubbles (0.38) */
.gm-npc { position: absolute; background: transparent; border: 0; cursor: pointer; border-radius: 8px; transition: box-shadow .14s; }
.gm-npc:hover { box-shadow: 0 0 0 2px rgba(255,220,140,0.5), 0 0 18px rgba(255,200,100,0.35); background: rgba(255,220,140,0.08); }
.gm-say { position: absolute; bottom: 102%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 200px; padding: 8px 11px; font-family: Georgia, serif; font-size: 12px; line-height: 1.5; color: #1c1206; background: #fff0d7; border: 2px solid #3a2410; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,0.5); z-index: 8; text-align: left; }
.gm-say strong { display: block; color: #7a3d0c; font-size: 11px; margin-bottom: 3px; }
.gm-say::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #3a2410; }

/* gatehouse — split join page (0.42 vividness) */
.gate { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 32px; align-items: center; max-width: 1000px; margin: 0 auto; padding: 20px 0 40px; }
.gate-tag { display: inline-block; font-family: Inter, sans-serif; font-size: 11px; letter-spacing: 2px; color: var(--gold); margin-bottom: 10px; }
.gate-pitch h2 { font-size: 34px; line-height: 1.1; margin: 0 0 12px; color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,0.4); }
.gate-lead { font-size: 14px; line-height: 1.7; color: #b6a7d4; margin: 0 0 22px; max-width: 52ch; }
.gate-benefits { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.gate-benefits li { display: flex; gap: 13px; align-items: flex-start; }
.gate-bi { font-size: 22px; line-height: 1.2; flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  background: radial-gradient(120% 120% at 30% 20%, #2a1a3e, #160d22); border: 1px solid #34254e; box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); }
.gate-benefits strong { display: block; color: #f0e9ff; font-size: 14.5px; margin-bottom: 2px; }
.gate-benefits p { margin: 0; font-size: 12.5px; line-height: 1.55; color: #9d8fc0; }
.gate-sso { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #cfe6ff; background: rgba(39,216,255,0.07); border: 1px solid rgba(39,216,255,0.18);
  border-radius: 10px; padding: 9px 13px; margin-bottom: 16px; }
.gate-sso b { color: #7fe9ff; font-weight: 600; }
.gate-live { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #b6a7d4; }
.gate-live b { color: #fff; font-size: 16px; } .gate-live i { width: 4px; height: 4px; border-radius: 50%; background: #4a3a68; }
.gate-form { display: flex; justify-content: center; }
.gate-board { position: static !important; transform: none !important; left: auto; top: auto; width: 100%; max-width: 400px; margin: 0; animation: none; }
@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; gap: 24px; max-width: 460px; }
  .gate-form { order: -1; }
  .gate-pitch h2 { font-size: 28px; }
}

/* booth first-run onboarding (0.43) */
.ap-booth-welcome { background: linear-gradient(180deg, rgba(39,216,255,0.06), rgba(20,14,30,0.2)); border: 1px solid #2a3f52; border-radius: 14px; padding: 20px 20px 18px; }
.ap-booth-welcome-ico { font-size: 30px; line-height: 1; display: inline-block; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.45)); }
.ap-booth-welcome h3 { margin: 8px 0 6px; color: #fff; font-size: 18px; }
.ap-booth-welcome > p { margin: 0 0 12px; color: #b6a7d4; font-size: 13px; line-height: 1.6; }
.ap-booth-welcome ol { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.ap-booth-welcome li { color: #d6ccec; font-size: 13px; line-height: 1.55; }
.ap-booth-welcome li b { color: #f0e9ff; }
.ap-on-word { color: #36f0b0; font-weight: 600; }

/* browse storefront header + publish-your-own card (0.44 vividness) */
.ap-store-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.ap-store-intro { flex: 1 1 320px; }
.ap-store-intro h2 { font-family: Georgia, "Times New Roman", serif; font-size: 26px; color: #fff; margin: 0 0 6px; text-shadow: 1px 1px 0 rgba(0,0,0,0.4); }
.ap-store-intro p { margin: 0; color: #b6a7d4; font-size: 13.5px; line-height: 1.6; max-width: 64ch; }
.ap-store-head .ap-search { margin-left: 0; min-width: 200px; }
.ap-card-add { align-items: flex-start; justify-content: center; text-align: left; background: linear-gradient(180deg, rgba(39,216,255,0.05), rgba(20,14,30,0.3));
  border: 1.5px dashed #3a5a6e; transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s; }
.ap-card-add:hover { border-color: #46c8e0; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.35); }
.ap-add-plus { font-size: 26px; line-height: 1; color: #46c8e0; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px;
  background: rgba(39,216,255,0.1); border: 1px solid rgba(39,216,255,0.25); }
.ap-card-add strong { color: #eaf6ff; font-size: 15px; }
.ap-card-add p { margin: 0; color: #9d8fc0; font-size: 12.5px; line-height: 1.55; }
.ap-add-cta { color: #46c8e0; font-size: 12.5px; font-weight: 600; margin-top: 2px; }

/* scroll-reveal + count-up motion (0.45) */
.reveal { transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
.hf-card.reveal { transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1), border-color .14s; }
.reveal:not(.in) { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal:not(.in) { opacity: 1 !important; transform: none !important; transition: none !important; } }

/* system status page (0.46) */
.st { max-width: 760px; margin: 0 auto; }
.st-title { font-family: Georgia, "Times New Roman", serif; font-size: 24px; color: #fff; margin: 0 0 16px; }
.st-banner { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; margin-bottom: 16px;
  background: linear-gradient(180deg, #160f24, #120c1d); border: 1px solid #2a1f3e; }
.st-banner.up { border-color: #2f6e52; box-shadow: inset 0 0 0 1px rgba(54,240,176,0.08); }
.st-banner.down { border-color: #7a3030; box-shadow: inset 0 0 0 1px rgba(255,122,140,0.1); }
.st-banner-txt { flex: 1; }
.st-banner-txt strong { display: block; color: #fff; font-size: 16px; }
.st-banner-txt p { margin: 3px 0 0; color: #9d8fc0; font-size: 12.5px; }
.st-beacon { width: 12px; height: 12px; border-radius: 50%; background: #f2b85f; box-shadow: 0 0 0 0 rgba(242,184,95,0.5); animation: mnpulse 2s infinite; }
.st-banner.up .st-beacon { background: #36f0b0; box-shadow: 0 0 0 0 rgba(54,240,176,0.5); }
.st-banner.down .st-beacon { background: #ff7a8c; box-shadow: 0 0 0 0 rgba(255,122,140,0.5); animation: none; }
.st-list { display: flex; flex-direction: column; gap: 1px; background: #241a36; border: 1px solid #241a36; border-radius: 12px; overflow: hidden; }
.st-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: #130d20; }
.st-pill { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.st-pill.up { background: #36f0b0; box-shadow: 0 0 8px rgba(54,240,176,0.6); }
.st-pill.down { background: #ff7a8c; box-shadow: 0 0 8px rgba(255,122,140,0.5); }
.st-pill.checking { background: #6a5a88; }
.st-name { color: #eaf2ff; font-size: 14px; min-width: 130px; }
.st-host { color: #7a6a98; font-size: 12px; font-family: ui-monospace, monospace; flex: 1; }
.st-ms { color: #9d8fc0; font-size: 12px; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.st-state { font-size: 11px; font-weight: 600; letter-spacing: 0.3px; min-width: 92px; text-align: right; }
.st-state.up { color: #36f0b0; } .st-state.down { color: #ff7a8c; } .st-state.checking { color: #b6a7d4; }
.st-foot { color: #7a6a98; font-size: 12px; line-height: 1.6; margin: 14px 2px 0; }
@media (max-width: 560px) { .st-host { display: none; } .st-name { min-width: 0; flex: 1; } }

/* homepage flow diagram (0.47) */
.fd { display: flex; align-items: stretch; gap: 0; margin: 6px 0 34px; flex-wrap: wrap; justify-content: center; }
.fd-node { flex: 1 1 220px; min-width: 200px; max-width: 320px; background: linear-gradient(180deg, #15102a, #0e0a18); border: 1px solid #271c3a; border-radius: 16px; padding: 18px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fd-ico { font-size: 30px; line-height: 1.1; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.45)); }
.fd-node strong { color: #fff; font-size: 15px; margin-top: 4px; }
.fd-sub { color: var(--cyan); font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase; }
.fd-node p { color: #a99cc8; font-size: 12.5px; line-height: 1.55; margin: 7px 0 0; }
.fd-link { flex: 0 0 56px; align-self: center; height: 3px; position: relative; border-radius: 3px; background: linear-gradient(90deg, #2a2040, #46c8e0, #2a2040); overflow: hidden; }
.fd-link i { position: absolute; top: 50%; left: 0; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #aef2ff; box-shadow: 0 0 9px #46c8e0; animation: fdflow 1.7s linear infinite; }
@keyframes fdflow { from { left: -8px; } to { left: calc(100% + 8px); } }
@media (max-width: 760px) {
  .fd { flex-direction: column; align-items: stretch; }
  .fd-node { max-width: none; }
  .fd-link { flex: 0 0 34px; width: 3px; height: 34px; align-self: center; background: linear-gradient(180deg, #2a2040, #46c8e0, #2a2040); }
  .fd-link i { left: 50%; top: 0; margin-left: -3.5px; margin-top: 0; animation: fdflowv 1.7s linear infinite; }
}
@keyframes fdflowv { from { top: -8px; } to { top: calc(100% + 8px); } }
@media (prefers-reduced-motion: reduce) { .fd-link i { animation: none; opacity: 0; } }

/* homepage session preview (0.49) */
.hf-demo { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 28px; align-items: center; }
.hf-demo-side h4 { color: #fff; font-size: 18px; margin: 0 0 8px; }
.hf-demo-side p { color: #b6a7d4; font-size: 13.5px; line-height: 1.65; margin: 0 0 14px; max-width: 46ch; }
.hf-demo-side code { background: #07060c; color: #7fe9ff; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.hf-demo-note { display: block; margin-top: 10px; color: #6f6090; font-size: 11px; font-style: italic; }
.cd { background: linear-gradient(180deg, #140e24, #100b1c); border: 1px solid #2c2046; border-radius: 16px; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,0.4); }
.cd-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: rgba(39,216,255,0.05); border-bottom: 1px solid #241a36; }
.cd-ava { font-size: 17px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: rgba(39,216,255,0.1); border: 1px solid rgba(39,216,255,0.25); }
.cd-head-t { display: flex; flex-direction: column; }
.cd-head-t strong { color: #fff; font-size: 13px; }
.cd-status { color: #8fe9c8; font-size: 11px; display: inline-flex; align-items: center; gap: 5px; }
.cd-status i { width: 6px; height: 6px; border-radius: 50%; background: #36f0b0; box-shadow: 0 0 6px #36f0b0; }
.cd-body { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; height: 252px; padding: 14px; overflow: hidden; }
.cd-msg { max-width: 84%; padding: 9px 12px; font-size: 12.5px; line-height: 1.5; border-radius: 13px; animation: cd-pop .32s ease-out; }
.cd-msg.user { align-self: flex-end; background: linear-gradient(180deg, #2aa7d8, #1f86c4); color: #052230; border-bottom-right-radius: 4px; }
.cd-msg.agent { align-self: flex-start; background: #1c1530; color: #e3d9f5; border: 1px solid #2e2348; border-bottom-left-radius: 4px; }
@keyframes cd-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.cd-typing { display: inline-flex; gap: 4px; padding: 12px 13px; align-self: flex-start; }
.cd-typing span { width: 6px; height: 6px; border-radius: 50%; background: #8a7aa8; animation: cd-bounce 1.2s infinite; }
.cd-typing span:nth-child(2) { animation-delay: .15s; } .cd-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cd-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.cd-foot { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid #241a36; }
.cd-input { flex: 1; color: #6f6090; font-size: 12.5px; }
.cd-send { color: #27d8ff; font-size: 14px; }
@media (max-width: 760px) { .hf-demo { grid-template-columns: 1fr; gap: 18px; } }
@media (prefers-reduced-motion: reduce) { .cd-msg { animation: none; } .cd-typing span { animation: none; } }

/* hero CTAs (0.50) */
.gm-cta { display: flex; gap: 12px; justify-content: center; margin: 12px 0 8px; flex-wrap: wrap; }
.gm-cta-btn { font-family: Georgia, "Times New Roman", serif; font-size: clamp(12.5px, 1.25vw, 15px); padding: 10px 22px; border-radius: 10px; cursor: pointer; border: none; transition: transform .15s, box-shadow .15s, background .15s; }
.gm-cta-primary { background: linear-gradient(180deg, #f3d27a, #d9a948); color: #2a1303; box-shadow: 0 6px 18px rgba(243,210,122,0.28), inset 0 1px 0 rgba(255,255,255,0.45); font-weight: 600; }
.gm-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(243,210,122,0.42); }
.gm-cta-secondary { background: rgba(18,12,28,0.66); color: #ecdfc6; box-shadow: inset 0 0 0 1.5px rgba(243,210,122,0.5); backdrop-filter: blur(2px); }
.gm-cta-secondary:hover { background: rgba(42,30,58,0.85); color: #fff; transform: translateY(-2px); }

/* browse loading skeletons (0.51) */
.ap-skel { pointer-events: none; }
.ap-skel-head { display: flex; align-items: center; gap: 11px; }
.sk-av, .sk-tt i, .sk-p, .ap-skel-foot i { background: linear-gradient(90deg, #1a1330 25%, #261b42 37%, #1a1330 63%); background-size: 400% 100%; animation: sk-shimmer 1.4s ease infinite; border-radius: 6px; display: block; }
.sk-av { width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto; }
.sk-tt { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sk-tt i { height: 11px; width: 60%; } .sk-tt i:last-child { width: 35%; height: 9px; }
.sk-p { height: 9px; width: 100%; margin-top: 12px; } .sk-p.sk-short { width: 70%; margin-top: 7px; }
.ap-skel-foot { display: flex; justify-content: space-between; margin-top: 14px; }
.ap-skel-foot i { height: 9px; width: 30%; }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk-av, .sk-tt i, .sk-p, .ap-skel-foot i { animation: none; } }

/* changelog timeline (0.52) */
.cl { max-width: 720px; margin: 0 auto; }
.cl-title { font-family: Georgia, "Times New Roman", serif; font-size: 26px; color: #fff; margin: 0 0 6px; }
.cl-lead { color: #b6a7d4; font-size: 14px; margin: 0 0 26px; line-height: 1.6; }
.cl-timeline { position: relative; padding-left: 26px; }
.cl-timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, #46c8e0, #46c8e0 30%, #2e2440); border-radius: 2px; }
.cl-item { position: relative; margin-bottom: 16px; }
.cl-dot { position: absolute; left: -26px; top: 17px; width: 12px; height: 12px; border-radius: 50%; background: #14101e; border: 2px solid #46c8e0; box-shadow: 0 0 8px rgba(70,200,224,0.5); }
.cl-item:first-child .cl-dot { background: #46c8e0; }
.cl-card { background: linear-gradient(180deg, #160f24, #120c1d); border: 1px solid #2a1f3e; border-radius: 12px; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.cl-card:hover { border-color: #46c8e0; transform: translateX(2px); }
.cl-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cl-ver { font-family: ui-monospace, monospace; font-size: 11px; font-weight: 700; color: #06222f; background: linear-gradient(180deg, #5fe6ff, #27d8ff); padding: 2px 8px; border-radius: 999px; }
.cl-card-head strong { color: #fff; font-size: 15px; }
.cl-date { margin-left: auto; color: #7a6a98; font-size: 12px; }
.cl-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.cl-card li { color: #b6a7d4; font-size: 13px; line-height: 1.5; }

/* clickable version pill + status pill (0.54) */
.px-ver { font-family: inherit; font-size: 7px; color: #6f5736; background: none; border: 0; cursor: pointer; letter-spacing: 0.5px; padding: 2px 5px; align-self: center; transition: color .15s; white-space: nowrap; }
.px-ver:hover { color: var(--cyan); }
.ft-status { font-family: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.ft-status:hover { transform: translateY(-1px); border-color: rgba(54,240,176,0.6); }

/* booth "bring it online" instance modal (0.55) */
.ap-steps { margin: 4px 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 13px; }
.ap-steps li { color: #d6ccec; font-size: 13px; line-height: 1.6; }
.ap-steps li b { color: #fff; }
.ap-steps li > code { background: #07060c; color: #7fe9ff; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.ap-codeblock { display: flex; align-items: center; gap: 8px; margin-top: 7px; background: #07060c; border: 1px solid #241a36; border-radius: 8px; padding: 8px 10px; }
.ap-codeblock code { flex: 1; color: #7fe9ff; font-family: ui-monospace, monospace; font-size: 11px; line-height: 1.5; word-break: break-all; white-space: pre-wrap; background: none; padding: 0; }
.ap-codeblock .px-action { flex: 0 0 auto; }

/* route transition (0.55+) */
.route-enter { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: route-in .34s cubic-bezier(.2,.7,.2,1); }
@keyframes route-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .route-enter { animation: none; } }

/* booth + mansion loading skeletons (0.57) */
.ap-mine-skel { display: flex; flex-direction: column; gap: 12px; }
.ap-skel-row { display: flex; align-items: center; gap: 11px; }
.mn-skel { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.mn-skel .ap-skel-row .sk-p { height: 12px; }

/* docs code blocks + copy button (0.58) */
.docs-render pre { position: relative; }
.docs-render pre code { background: none; padding: 0; color: #cfe8ff; font-size: 0.86em; line-height: 1.6; }
.docs-code { position: relative; margin: 14px 0; }
.docs-code pre { margin: 0; }
.docs-copy { position: absolute; top: 8px; right: 8px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 11px; padding: 3px 10px; border-radius: 6px; background: #1b2536; color: #9fc8e8; border: 1px solid #2a3a52; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; }
.docs-code:hover .docs-copy { opacity: 1; }
.docs-copy:hover { background: var(--accent); color: #061018; border-color: transparent; }

/* keyboard focus indicators — visible for keyboard users only (a11y, 0.59) */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.gm-cta-primary:focus-visible, .px-action:focus-visible { outline-color: #f3d27a; }

/* docs syntax highlight tokens (0.61) */
.docs-render pre code .hl-str { color: #9ce5a4; }
.docs-render pre code .hl-num { color: #f0b86a; }
.docs-render pre code .hl-kw { color: #c79aef; }

/* themed task-list checkboxes in docs (0.63) */
.docs-render input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.docs-render li:has(> input[type="checkbox"]) { list-style: none; margin-left: -20px; }

/* error boundary fallback (0.64) */
.eb { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 28%, #160d22, #07060c 70%); padding: 24px; }
.eb-card { max-width: 420px; text-align: center; background: linear-gradient(180deg, #160f24, #110b1d); border: 1px solid #2a1f3e; border-radius: 16px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); font-family: Georgia, "Times New Roman", serif; }
.eb-gem { width: 26px; height: 26px; display: inline-block; background: linear-gradient(135deg, #5fe6ff, #1f86c4); transform: rotate(45deg); box-shadow: 0 0 0 3px #07273a, 0 0 24px rgba(39,216,255,0.5); margin-bottom: 20px; }
.eb-card h1 { color: #f3d27a; font-size: 22px; margin: 0 0 10px; }
.eb-card p { color: #b6a7d4; font-size: 14px; line-height: 1.6; margin: 0 0 22px; }
.eb-actions { display: flex; gap: 12px; justify-content: center; align-items: center; }
.eb-actions button { font-family: Georgia, serif; font-size: 14px; padding: 9px 22px; border-radius: 10px; border: none; cursor: pointer; background: linear-gradient(180deg, #f3d27a, #d9a948); color: #2a1303; font-weight: 600; }
.eb-actions a { font-family: Georgia, serif; font-size: 14px; color: #cfe6ff; text-decoration: none; }
.eb-actions a:hover { color: #7fe9ff; }

/* persistent home host (0.65) — keeps the tavern mounted, hidden off-route */
.route-host { flex: 1; min-height: 0; flex-direction: column; }

/* back-to-top button (0.66) */
.gm-totop { position: fixed; right: 22px; bottom: 22px; width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(180deg, #2aa7d8, #1f86c4); color: #fff; font-size: 20px; line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s, background .15s; z-index: 30; }
.gm-totop.show { opacity: 0.92; transform: none; pointer-events: auto; }
.gm-totop.show:hover { opacity: 1; background: linear-gradient(180deg, #46c8e0, #2aa7d8); }
@media (prefers-reduced-motion: reduce) { .gm-totop { transition: opacity .2s; transform: none; } }

/* polished logged-out gates (0.67) */
.ap-gate-rich { max-width: 480px; margin: 44px auto 0; text-align: center; }
.ap-gate-ico { font-size: 40px; display: block; margin-bottom: 12px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }
.ap-gate-rich h2 { font-family: Georgia, "Times New Roman", serif; font-size: 24px; color: #fff; margin: 0 0 10px; }
.ap-gate-rich p { color: #b6a7d4; font-size: 14px; line-height: 1.65; margin: 0 0 22px; }
.ap-gate-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* skip-to-content link — visible only on keyboard focus (a11y, 0.72) */
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; background: var(--cyan); color: #06222f;
  font-family: Georgia, "Times New Roman", serif; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 9px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4); text-decoration: none; transform: translateY(-160%); transition: transform .16s ease-out; }
.skip-link:focus, .skip-link:focus-visible { transform: none; outline: 2px solid #fff; outline-offset: 2px; }

/* browse: no-search-results state (0.73) */
.ap-empty-search { grid-column: 1 / -1; text-align: center; padding: 44px 20px; color: #b6a7d4; }
.ap-empty-search-ico { font-size: 34px; display: block; margin-bottom: 10px; opacity: 0.85; }
.ap-empty-search h3 { color: #fff; font-size: 18px; margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; }
.ap-empty-search p { margin: 0 0 16px; font-size: 13px; }

/* docs responsive — stack on mobile so the prose gets full width (0.77) */
@media (max-width: 760px) {
  .docs { flex-direction: column; }
  .docs-side { width: 100%; overflow: visible; border-right: none; border-bottom: 2px solid #1b2536; }
  .docs-nav-toggle { display: flex; }
  .docs-side-body { display: none; }
  .docs-side-body.open { display: block; border-bottom: 1px solid #1b2536; }
  .docs-side-body.open .docs-tree { max-height: 58vh; overflow-y: auto; }
  .docs-main { padding: 20px 16px; }
}

/* branded app loading screen (Suspense fallback) (0.78) */
.app-loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: radial-gradient(circle at 50% 38%, #160d22, #07060c 70%); }
.app-loading-gem { width: 28px; height: 28px; background: linear-gradient(135deg, #5fe6ff, #1f86c4); box-shadow: 0 0 0 3px #07273a, 0 0 22px rgba(39,216,255,0.5); animation: app-pulse 1.3s ease-in-out infinite; }
.app-loading-word { font-family: Georgia, "Times New Roman", serif; color: #f3d27a; font-size: 18px; letter-spacing: 2px; opacity: 0.85; }
@keyframes app-pulse { 0%, 100% { transform: rotate(45deg) scale(1); opacity: 0.7; } 50% { transform: rotate(45deg) scale(1.16); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .app-loading-gem { animation: none; transform: rotate(45deg); } }

/* agent-native callout (0.83) */
.hf-agentnative { max-width: 760px; margin: 30px auto 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 22px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(39,216,255,0.08), rgba(20,14,30,0.3)); border: 1px solid #2f5e6e; box-shadow: 0 0 0 1px rgba(39,216,255,0.06); }
.hf-an-head { display: flex; gap: 16px; align-items: center; }
.hf-an-ico { font-size: 34px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4)); }
.hf-an-body h3 { margin: 0 0 5px; color: #fff; font-size: 17px; }
.hf-an-body p { margin: 0; color: #b6a7d4; font-size: 13.5px; line-height: 1.6; }
.hf-an-body b { color: #7fe9ff; font-weight: 600; }
.hf-an-body a { color: #46c8e0; }
/* live API peek inside the agent-native callout (0.92) */
.hf-peek { border-radius: 12px; overflow: hidden; border: 1px solid #20384a; background: #0a0e16; text-align: left; }
.hf-peek-tabs { display: flex; gap: 2px; padding: 7px 8px 0; background: #0c1320; }
.hf-peek-tab { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: #7f93a8; background: none; border: none; padding: 5px 12px; border-radius: 7px 7px 0 0; cursor: pointer; }
.hf-peek-tab:hover { color: #cfe2f2; }
.hf-peek-tab.on { color: #07111a; background: #46c8e0; font-weight: 600; }
.hf-peek-term { padding: 11px 14px 13px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.hf-peek-cmd { color: #9fd9e8; margin-bottom: 8px; word-break: break-all; }
.hf-peek-dollar { color: #5b6b7d; margin-right: 6px; }
.hf-peek-out { margin: 0; max-height: 186px; overflow: auto; color: #c6d4e2; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.hf-peek-loading { color: #5b6b7d; }
.j-key { color: #7fe9ff; } .j-str { color: #9ee8a6; } .j-num { color: #f3b86a; } .j-lit { color: #c79bf0; }
@media (max-width: 600px) { .hf-an-head { flex-direction: column; text-align: center; } }

/* docs: on-this-page TOC + heading anchors (0.88) */
.docs-toc { margin: 4px 0 24px; padding: 13px 16px; border: 1px solid #2a2140; border-radius: 12px; background: rgba(39, 216, 255, 0.03); display: flex; flex-direction: column; gap: 1px; }
.docs-toc-h { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #6f5b8c; margin-bottom: 6px; }
.docs-toc-link { text-align: left; background: none; border: none; color: #b9a7e0; font-size: 13.5px; line-height: 1.4; padding: 4px 8px; border-radius: 6px; cursor: pointer; transition: background 0.12s, color 0.12s; }
.docs-toc-link:hover { background: rgba(39, 216, 255, 0.08); color: #fff; }
.docs-toc-link.lvl3 { padding-left: 22px; font-size: 12.5px; color: #9a89bd; }
.docs-render h2, .docs-render h3 { position: relative; scroll-margin-top: 28px; }
.docs-anchor { opacity: 0; margin-left: 9px; padding: 0 2px; background: none; border: none; color: #46c8e0; cursor: pointer; font-size: 0.8em; font-weight: 600; text-decoration: none; vertical-align: middle; transition: opacity 0.12s; }
.docs-render h2:hover .docs-anchor, .docs-render h3:hover .docs-anchor, .docs-anchor:focus-visible { opacity: 0.85; }
.docs-anchor:hover { opacity: 1; }

/* docs full-text search results (0.93) */
.docs-results { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.docs-result { display: flex; flex-direction: column; gap: 3px; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.docs-result:hover { background: #131c2b; }
.docs-result.on { background: #1a2740; }
.docs-result-title { color: #eaf2ff; font-size: 13.5px; font-weight: 600; }
.docs-result-snip { color: #8595ab; font-size: 12px; line-height: 1.45; }
.docs-result-snip mark { background: rgba(39, 216, 255, 0.22); color: #d6f0f8; border-radius: 2px; padding: 0 1px; }

/* key-minting "try it" curl example (0.94) */
.ap-keys-try { margin: 13px 0 5px; color: #b6a7d4; font-size: 12.5px; }
.ap-keys-curl { display: flex; align-items: center; gap: 8px; background: #0a0e16; border: 1px solid #20384a; border-radius: 9px; padding: 9px 11px; }
.ap-keys-curl code { flex: 1; min-width: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; color: #cfe2f2; overflow-x: auto; white-space: nowrap; }
.ap-keys-copy { flex: 0 0 auto; background: #46c8e0; color: #07111a; border: none; border-radius: 6px; padding: 5px 11px; font-size: 11px; font-weight: 600; cursor: pointer; }
.ap-keys-copy:hover { background: #6ad6ea; }

/* api peek: response status/timing bar + run button (0.98) */
.hf-peek-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 9px; font-size: 11px; }
.hf-peek-status { display: flex; align-items: center; gap: 7px; color: #8fa3b8; min-height: 18px; }
.hf-peek-muted { color: #5b6b7d; }
.hf-peek-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.hf-peek-dot.ok { background: #4ee08a; box-shadow: 0 0 7px #4ee08a; }
.hf-peek-dot.err { background: #ff6b6b; box-shadow: 0 0 7px #ff6b6b; }
.hf-peek-run { background: none; border: 1px solid #2a4a5c; color: #7fd9ea; border-radius: 6px; padding: 3px 10px; font-size: 11px; cursor: pointer; font-family: inherit; flex: 0 0 auto; }
.hf-peek-run:hover:not(:disabled) { background: rgba(39, 216, 255, 0.1); color: #cfeff7; }
.hf-peek-run:disabled { opacity: 0.5; cursor: default; }

/* booth publish form: labelled fields (0.99) */
.ap-pub-field { display: flex; flex-direction: column; gap: 4px; }
.ap-pub-field > span { font-size: 11px; color: #8a7bb0; letter-spacing: 0.3px; }
.ap-row .ap-pub-field { flex: 1; }

/* native chat panel (1.1) — long-poll chat, file relay, chatlog */
.ch { display: flex; flex-direction: column; background: #0b0f1a; border: 1px solid #2a2440; border-radius: 12px; overflow: hidden; min-height: 380px; max-height: 64vh; }
.ch-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #131022; border-bottom: 1px solid #2a2440; }
.ch-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #555; }
.ch-dot.online { background: #36f0b0; box-shadow: 0 0 8px #36f0b0; animation: chpulse 2s infinite; }
.ch-dot.pending { background: #f2b85f; }
.ch-dot.lost { background: #ff9f5a; }
.ch-dot.down { background: #ff7a8c; }
@keyframes chpulse { 0%, 100% { box-shadow: 0 0 4px #36f0b0; } 50% { box-shadow: 0 0 11px #36f0b0; } }
.ch-head-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ch-head-t strong { color: #eee6ff; font-size: 13.5px; }
.ch-sub { color: #8a7bb0; font-size: 11px; }
.ch-x { background: none; border: 1px solid #3a3354; color: #b6a7d4; border-radius: 7px; padding: 4px 10px; font-size: 11px; cursor: pointer; font-family: inherit; flex: 0 0 auto; }
.ch-x:hover { border-color: #6a5a9a; color: #eee6ff; }
.ch-skills { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 7px 12px; background: #0e1320; border-bottom: 1px solid #1c2438; }
.ch-skills-label { color: #5b6b7d; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; }
.ch-skill { background: rgba(39, 216, 255, 0.09); border: 1px solid #1f4456; color: #7fd9ea; border-radius: 999px; padding: 2px 9px; font-size: 11px; }
.ch-body { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 9px; }
.ch-event { text-align: center; color: #5b6b7d; font-size: 11px; padding: 2px 0; }
.ch-msg { max-width: 82%; padding: 8px 12px; border-radius: 13px; position: relative; }
.ch-msg p { margin: 0; color: #e8eef8; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.ch-msg.mine { align-self: flex-end; background: #2a2360; border: 1px solid #443a7e; border-bottom-right-radius: 4px; }
.ch-msg.theirs { align-self: flex-start; background: #151c2c; border: 1px solid #243049; border-bottom-left-radius: 4px; }
.ch-when { display: block; margin-top: 3px; color: #5e5876; font-size: 9.5px; text-align: right; }
.ch-file { display: flex; align-items: center; gap: 10px; }
.ch-file-ico { font-size: 22px; }
.ch-file-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ch-file-meta strong { color: #eee6ff; font-size: 12.5px; word-break: break-all; }
.ch-file-meta span { color: #8a7bb0; font-size: 10.5px; }
.ch-file-get { flex: 0 0 auto; text-decoration: none; font-size: 11px; }
.ch-file-sent { color: #36f0b0; font-size: 11px; flex: 0 0 auto; }
.ch-file-gone { color: #6e6788; font-size: 10.5px; font-style: italic; }
.ch-upload { display: flex; align-items: center; gap: 9px; padding: 7px 12px; background: #10182a; border-top: 1px solid #1c2438; font-size: 11.5px; color: #b6c5da; }
.ch-upload-bar { flex: 1; height: 6px; background: #1a2438; border-radius: 99px; overflow: hidden; }
.ch-upload-bar i { display: block; height: 100%; background: linear-gradient(90deg, #46c8e0, #7fd9ea); border-radius: 99px; transition: width 0.2s; }
.ch-upload-phase { color: #7fd9ea; flex: 0 0 auto; }
.ch-err { margin: 4px 12px; }
.ch-foot { display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: #131022; border-top: 1px solid #2a2440; }
.ch-attach { cursor: pointer; font-size: 17px; padding: 4px 7px; border-radius: 8px; border: 1px solid #3a3354; line-height: 1; }
.ch-attach:hover { border-color: #6a5a9a; background: #1c1733; }
.ch-input { flex: 1; background: #0b0f1a; border: 1px solid #3a3354; color: #e8eef8; border-radius: 9px; padding: 9px 12px; font-size: 13px; font-family: inherit; outline: none; }
.ch-input:focus { border-color: #6a5a9a; }
.ch-send { background: #46c8e0; color: #07111a; border: none; border-radius: 9px; padding: 8px 15px; font-size: 14px; cursor: pointer; }
.ch-send:disabled { opacity: 0.35; cursor: default; }
.ch-send:hover:not(:disabled) { background: #6ad6ea; }
.ch-foot-closed { justify-content: center; color: #6e6788; font-size: 11.5px; font-style: italic; }
/* chatlog list (Legion) */
.ap-chatlog { margin-top: 20px; background: #11101e; border: 1px solid #2a2440; border-radius: 12px; padding: 14px 16px; }
.ch-log { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ch-log-row { display: flex; align-items: center; gap: 10px; background: #0b0f1a; border: 1px solid #243049; border-radius: 10px; padding: 9px 12px; cursor: pointer; text-align: left; font-family: inherit; }
.ch-log-row:hover { border-color: #46c8e0; }
.ch-log-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ch-log-main strong { color: #eee6ff; font-size: 12.5px; }
.ch-log-main em { color: #8a7bb0; font-style: normal; font-weight: 400; font-size: 11px; }
.ch-log-last { color: #8595ab; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-log-meta { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; color: #5b6b7d; font-size: 10.5px; flex: 0 0 auto; }
.ap-modal-chat { width: min(660px, 94vw); padding: 10px; }

/* class runtime properties + Legion card reuse (1.2) */
.ap-props { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.ap-prop { background: #131a29; border: 1px solid #243049; color: #9fb2c8; border-radius: 999px; padding: 3px 11px; font-size: 11px; }
.ap-prop.managed { background: rgba(54, 240, 176, 0.07); border-color: #1f5642; color: #5fe0b0; }
.ap-pub-props { display: flex; flex-direction: column; gap: 9px; margin: 4px 0 2px; padding: 10px 12px; background: #0d1320; border: 1px solid #20283c; border-radius: 10px; }
.ap-check { display: flex; align-items: center; gap: 8px; color: #b6c5da; font-size: 12px; cursor: pointer; }
.ap-check input { accent-color: #46c8e0; width: 14px; height: 14px; }
.ap-mine-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ap-mine-cardwrap { display: flex; flex-direction: column; gap: 7px; }
.ap-mine-cardwrap .ap-card { width: 100%; }
.ap-mine-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* mansion file rooms (1.3): file-mapper + net-disk quota */
.mn-quota { display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; }
.mn-quota-bar { flex: 1; height: 8px; background: #1a2438; border-radius: 99px; overflow: hidden; }
.mn-quota-bar i { display: block; height: 100%; background: linear-gradient(90deg, #46c8e0, #7fd9ea); border-radius: 99px; transition: width 0.3s; }
.mn-quota-label { color: #8fa3b8; font-size: 11.5px; flex: 0 0 auto; }
.mn-fm-meta { color: #6e7e94; font-size: 11px; }
.mn-nd { margin-top: 10px; background: #0b0f1a; border: 1px solid #20283c; border-radius: 10px; padding: 8px; }

/* ===== the game IS the page (1.4) — full-screen diegetic tavern ===== */
.gm-game { height: calc(100dvh - 52px); display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; overflow: hidden; padding: 0; background: radial-gradient(ellipse at 50% 30%, #171028 0%, #0a0712 70%); }
.gm-stage3 { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 6px 8px 0; }
.gm-bottombar { width: 100%; }
.gm-stage3 .gm-room { position: relative; aspect-ratio: 16 / 9; width: min(100%, calc((100dvh - 196px) * 1.7778)); box-shadow: 0 0 0 2px #2a2440, 0 0 60px rgba(70, 40, 140, 0.35), 0 24px 80px rgba(0, 0, 0, 0.6); border-radius: 6px; overflow: hidden; }
.gm-stage3 .gm-canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.gm-bottombar { flex: 0 0 auto; text-align: center; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.gm-tagline { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(20px, 3.4vw, 34px); color: #f3e9d2; letter-spacing: 0.5px; text-shadow: 0 2px 18px rgba(255, 200, 120, 0.25); }
.gm-cursor { color: #46c8e0; animation: gmblink 1.1s steps(1) infinite; }
@keyframes gmblink { 50% { opacity: 0; } }
.gm-tagsub { margin: 0; color: #8a7bb0; font-size: clamp(11px, 1.5vw, 13.5px); }
.gm-link { background: none; border: none; color: #7fd9ea; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.gm-link:hover { color: #cfeff7; }

/* diegetic speech bubbles */
.gm-bub { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-family: inherit; z-index: 4; max-width: 220px; transition: transform 0.15s, box-shadow 0.15s; }
.gm-bub:hover { transform: translate(-50%, -104%) scale(1.04); z-index: 6; }
.gm-bub strong { font-size: 12px; letter-spacing: 0.6px; }
.gm-bub span { font-size: 11px; line-height: 1.45; }
.gm-bub i, .gm-bub em { font-style: normal; font-size: 11px; line-height: 1.5; }
.gm-bub em { margin-top: 3px; opacity: 0.85; }
.gm-bub-tail { position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.gm-bub-float { animation: gmfloat 3.4s ease-in-out infinite; }
@keyframes gmfloat { 0%, 100% { margin-top: 0; } 50% { margin-top: -5px; } }
.gm-bub-wood { background: linear-gradient(180deg, #241509f0, #170d05f0); border: 2px solid #8a5a32; color: #f3e3c2; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 10px 26px rgba(0, 0, 0, 0.5); }
.gm-bub-wood strong { color: #ffd75e; }
.gm-bub-wood .gm-bub-tail { background: #1d1107; border-right: 2px solid #8a5a32; border-bottom: 2px solid #8a5a32; }
.gm-bub-holo { background: linear-gradient(180deg, rgba(10, 40, 64, 0.88), rgba(8, 24, 44, 0.88)); border: 1.5px solid #46c8e0; color: #bfeefb; box-shadow: 0 0 18px rgba(70, 200, 235, 0.35), inset 0 0 24px rgba(70, 200, 235, 0.12); backdrop-filter: blur(2px); background-image: repeating-linear-gradient(0deg, rgba(127, 233, 255, 0.05) 0 1px, transparent 1px 3px); }
.gm-bub-holo strong { color: #7fe9ff; text-shadow: 0 0 8px rgba(127, 233, 255, 0.6); }
.gm-bub-holo em { color: #ffd75e; }
.gm-bub-holo .gm-bub-tail { background: rgba(9, 30, 52, 0.95); border-right: 1.5px solid #46c8e0; border-bottom: 1.5px solid #46c8e0; }
.gm-bub-door { background: linear-gradient(180deg, rgba(40, 28, 6, 0.92), rgba(26, 16, 4, 0.92)); border: 2px solid #ffd75e; color: #ffe9b0; box-shadow: 0 0 20px rgba(255, 215, 94, 0.3); }
.gm-bub-door strong { color: #ffd75e; letter-spacing: 1.5px; }
.gm-bub-door .gm-bub-tail { background: #1c1204; border-right: 2px solid #ffd75e; border-bottom: 2px solid #ffd75e; }
.gm-bub-sm { padding: 5px 10px; }
.gm-bub-sm strong { font-size: 10.5px; }

/* ornate in-game dialog */
.gd-backdrop { position: fixed; inset: 0; background: rgba(5, 3, 12, 0.72); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 18px; animation: gdfade 0.18s ease-out; }
@keyframes gdfade { from { opacity: 0; } }
.gd { position: relative; width: min(520px, 94vw); max-height: 86vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #14102a, #0c0918); border: 2px solid #46c8e0; border-radius: 14px; box-shadow: 0 0 0 1px #2a2440, 0 0 50px rgba(70, 200, 235, 0.25), 0 30px 90px rgba(0, 0, 0, 0.7); animation: gdpop 0.22s cubic-bezier(0.2, 1.4, 0.4, 1); }
.gd-wide { width: min(960px, 96vw); }
@keyframes gdpop { from { transform: scale(0.92) translateY(10px); opacity: 0; } }
.gd-gem { position: absolute; width: 11px; height: 11px; background: linear-gradient(135deg, #7fe9ff, #2787c8); transform: rotate(45deg); box-shadow: 0 0 10px rgba(127, 233, 255, 0.8); border-radius: 2px; }
.gd-gem.tl { top: -6px; left: -6px; } .gd-gem.tr { top: -6px; right: -6px; }
.gd-gem.bl { bottom: -6px; left: -6px; } .gd-gem.br { bottom: -6px; right: -6px; }
.gd-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid #2a2440; }
.gd-tag { font-size: 10px; letter-spacing: 1.4px; color: #7fd9ea; background: rgba(70, 200, 235, 0.08); border: 1px solid #1f4456; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.gd-head h3 { margin: 0; flex: 1; font-family: Georgia, serif; font-size: 19px; color: #f3e9d2; }
.gd-x { background: none; border: 1px solid #3a3354; color: #b6a7d4; border-radius: 7px; padding: 4px 10px; cursor: pointer; font-family: inherit; }
.gd-x:hover { border-color: #6a5a9a; color: #fff; }
.gd-body { overflow-y: auto; padding: 14px 18px 18px; }
.gd-lead { color: #b6a7d4; font-size: 13px; margin: 0 0 12px; }
.gd-body .hf { padding: 6px 2px 10px; }
.gd-body .hf-title { font-size: 22px; margin-top: 0; }

@media (max-width: 700px) {
  .gm-bub { max-width: 150px; padding: 6px 9px; }
  .gm-bub i { display: none; }
  .gm-bub span { font-size: 10px; }
  .gm-stage3 { padding: 4px; }
  .gm-tagline { font-size: 19px; }
}

/* ===== Browse = the roster door; mercenaries descend (2.1) ===== */
.apb { max-width: 1080px; margin: 0 auto; }
.apb-doorway { display: flex; align-items: center; gap: 20px; padding: 14px 4px 18px; }
.apb-door { position: relative; flex: 0 0 auto; width: 96px; height: 116px; border-radius: 48px 48px 8px 8px; background: #20140a; border: 3px solid #5a3a1c; overflow: hidden; box-shadow: inset 0 0 18px rgba(0,0,0,0.7); perspective: 200px; }
.apb-door-light { position: absolute; inset: 4px; border-radius: 44px 44px 6px 6px; background: radial-gradient(ellipse at 50% 40%, rgba(127,233,255,0.85), rgba(40,120,200,0.35) 55%, transparent 75%); animation: apbGlow 3s ease-in-out infinite; }
@keyframes apbGlow { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }
.apb-door-leaf { position: absolute; top: 0; width: 50%; height: 100%; background: linear-gradient(180deg, #6b4326, #3a2414); transform-origin: var(--o) center; box-shadow: inset 0 0 8px rgba(0,0,0,0.6); }
.apb-door-leaf.l { left: 0; --o: left; transform: rotateY(58deg); border-right: 2px solid #2a1810; border-radius: 46px 0 0 6px; }
.apb-door-leaf.r { right: 0; --o: right; transform: rotateY(-58deg); border-left: 2px solid #2a1810; border-radius: 0 46px 6px 0; }
.apb-doorhead { flex: 1; min-width: 0; }
.apb-doorhead h2 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 24px; color: #f3e9d2; }
.apb-doorhead p { margin: 0 0 10px; color: #9b8fb8; font-size: 13px; }
.apb-doorhead .ap-search { width: min(360px, 100%); }

.apb-stage { display: flex; flex-wrap: wrap; gap: 30px 22px; padding: 30px 6px 24px; align-items: flex-start; }
@keyframes apbDrop { from { transform: translateY(-46px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.apb-merc { position: relative; width: 156px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; animation: apbDrop 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) backwards; animation-delay: var(--d, 0ms); }
.apb-rope { position: absolute; top: -30px; left: 50%; width: 2px; height: 30px; background: linear-gradient(180deg, transparent, #6b5a3a); transform: translateX(-50%); }
.apb-bub { position: relative; background: linear-gradient(180deg, #241509, #170d05); border: 2px solid #8a5a32; color: #f3e3c2; border-radius: 11px; padding: 8px 11px; font-size: 11.5px; line-height: 1.4; text-align: left; min-height: 38px; display: flex; align-items: center; box-shadow: 0 3px 0 rgba(0,0,0,0.4); width: 100%; box-sizing: border-box; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.apb-bub-tail { position: absolute; left: 50%; bottom: -7px; width: 11px; height: 11px; background: #170d05; border-right: 2px solid #8a5a32; border-bottom: 2px solid #8a5a32; transform: translateX(-50%) rotate(45deg); }
.apb-portrait { position: relative; width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 0 0 3px #2a2440, 0 8px 18px rgba(0,0,0,0.5); transition: transform 0.15s; }
.apb-merc:hover .apb-portrait { transform: scale(1.07) translateY(-2px); }
.apb-merc:hover .apb-bub { border-color: #ffd75e; }
.apb-emoji { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.apb-life { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #0c0918; }
.apb-life.on { background: #36f0b0; box-shadow: 0 0 9px #36f0b0; animation: chpulse 2s infinite; }
.apb-life.off { background: #54607a; }
.apb-crest { position: absolute; left: -4px; top: -4px; font-size: 15px; filter: drop-shadow(0 0 4px rgba(54,240,176,0.6)); }
.apb-name { color: #eee6ff; font-size: 13.5px; text-align: center; }
.apb-meta { color: #8a7bb0; font-size: 10.5px; text-align: center; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: center; }
.apb-tag-chip { background: #1a2740; border: 1px solid #2a3a5a; color: #9fb2c8; border-radius: 999px; padding: 1px 7px; font-size: 9.5px; }
.apb-portrait-add { background: #141022; border: 2px dashed #4a3f6e; color: #8a7bb0; font-size: 28px; box-shadow: none; }
.apb-merc-add .apb-name { color: #b6a7d4; }
.apb-skel { pointer-events: none; }
.apb-skel .apb-bub { border-color: #243049; }

/* ClassModal as a war-banner dialog: squad of soldiers */
.cm-top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.cm-avatar { width: 64px; height: 64px; font-size: 30px; flex: 0 0 auto; }
.cm-top-body { min-width: 0; }
.cm-top-body .ap-desc { margin: 6px 0 8px; }
.cm-squad { display: flex; flex-direction: column; gap: 8px; }
.cm-sol { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid #243049; background: #0b0f1a; }
.cm-sol.alive { border-color: #1f5642; box-shadow: inset 0 0 16px rgba(54,240,176,0.06); }
.cm-sol.fallen { opacity: 0.62; }
.cm-sol-ico { font-size: 24px; filter: grayscale(0); }
.cm-sol.fallen .cm-sol-ico { filter: grayscale(0.5); }
.cm-sol-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-sol-body strong { color: #eee6ff; font-size: 13px; }
.cm-sol-meta { display: flex; align-items: center; gap: 6px; color: #8a7bb0; font-size: 11px; }
.cm-sol-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
@media (max-width: 620px) { .apb-merc { width: 132px; } .apb-doorway { flex-wrap: wrap; } }

/* ===== My Legion = the war camp (2.2): banners + soldiers ===== */
.lg-camp { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 18px; margin-bottom: 8px; }
.lg-unit { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lg-banner { position: relative; width: 100%; padding: 14px 10px 26px; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; font-family: inherit; color: #eee6ff; background: linear-gradient(180deg, #2a1d4e, #170f2c); border: 1px solid #443a7e; border-top: 4px solid #7a6ab0; clip-path: polygon(0 0, 100% 0, 100% 88%, 50% 100%, 0 88%); transition: transform 0.14s, border-color 0.14s; }
.lg-banner:hover { transform: translateY(-3px); border-top-color: #ffd75e; }
.lg-banner::before { content: ''; position: absolute; top: -10px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: #ffd75e; transform: translateX(-50%); box-shadow: 0 0 8px #ffd75e; }
.lg-banner-crest { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 0 0 2px rgba(255,255,255,0.08); }
.lg-banner strong { font-size: 13.5px; text-align: center; line-height: 1.2; }
.lg-banner-sub { font-size: 10.5px; color: #b6a7d4; }
.lg-banner-count { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #9fb2c8; }
.lg-banner-count i { width: 7px; height: 7px; border-radius: 50%; }
.lg-soldiers { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; min-height: 30px; }
.lg-sol { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 50px; padding: 5px 2px; border-radius: 9px; cursor: pointer; font-family: inherit; background: #11101e; border: 1px solid #2a2440; transition: transform 0.12s, border-color 0.12s; }
.lg-sol:hover { transform: translateY(-2px); border-color: #6a5a9a; }
.lg-sol-fig { font-size: 22px; line-height: 1; }
.lg-sol-id { font-size: 9.5px; color: #8a7bb0; }
.lg-sol-status { font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.lg-sol.alive { border-color: #1f5642; box-shadow: 0 0 10px rgba(54,240,176,0.12); }
.lg-sol.alive .lg-sol-status { color: #36f0b0; }
@keyframes solbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.lg-sol.alive .lg-sol-fig { animation: solbob 1.7s ease-in-out infinite; }
.lg-sol.pending .lg-sol-status { color: #f2b85f; }
.lg-sol.fallen { opacity: 0.5; }
.lg-sol.fallen .lg-sol-status { color: #ff7a8c; }
.lg-recruit { width: 50px; height: 56px; border-radius: 9px; border: 1px dashed #4a3f6e; background: #0d0b18; color: #6a5a9a; font-size: 22px; cursor: pointer; transition: border-color 0.12s, color 0.12s; }
.lg-recruit:hover { border-color: #46c8e0; color: #7fd9ea; }
/* soldier dialog */
.lg-sd-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.lg-sd-meta { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 1px; }
.lg-sd-meta strong { color: #eee6ff; font-size: 13px; }
.lg-sd-meta span { color: #8a7bb0; font-size: 11px; }
.lg-sd-key { font-size: 11px; }
.lg-standdown { background: #2a1620 !important; border: 1px solid #5a2030 !important; color: #ff9fb0 !important; }
.lg-sd-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.lg-sd-tabs button { background: #11101e; border: 1px solid #2a2440; color: #b6a7d4; border-radius: 8px; padding: 5px 14px; font-size: 12px; cursor: pointer; font-family: inherit; }
.lg-sd-tabs button.on { background: #2a2360; border-color: #6a5a9a; color: #fff; }
.lg-sd-status { display: flex; flex-direction: column; gap: 10px; }
.lg-tui { background: #05070c; border: 1px solid #1c2438; border-radius: 9px; overflow: hidden; }
.lg-tui-head { padding: 5px 11px; background: #0d1320; color: #5b6b7d; font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; border-bottom: 1px solid #1c2438; }
.lg-tui pre { margin: 0; padding: 11px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #9fe6c0; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.lg-rouse { margin-top: 2px; }

/* ===== My Mansion = a villa estate (2.3) ===== */
.mn-villa { display: flex; align-items: stretch; gap: 22px; margin-bottom: 18px; background: linear-gradient(180deg, #15102a, #0d0a18); border: 1px solid #2a2440; border-radius: 16px; padding: 16px; overflow: hidden; }
.mn-villa-scene { position: relative; flex: 0 0 auto; width: 300px; height: 200px; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #1a1840 0%, #3a2a5a 55%, #5a3a4a 78%, #2a1d2a 100%); box-shadow: inset 0 0 30px rgba(0,0,0,0.5); }
.mn-villa-moon { position: absolute; right: 26px; top: 22px; width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 38% 35%, #fff6e0, #ffd98a 60%, #e8b860); box-shadow: 0 0 24px rgba(255,220,150,0.6); }
.mn-villa-star { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 5px #fff; animation: mnTwinkle 3s ease-in-out infinite; }
@keyframes mnTwinkle { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.mn-villa-roof { position: absolute; left: 50px; bottom: 102px; width: 0; height: 0; border-left: 100px solid transparent; border-right: 100px solid transparent; border-bottom: 46px solid #5a2e22; filter: drop-shadow(0 -2px 0 #7a3e2e); }
.mn-villa-house { position: absolute; left: 70px; bottom: 26px; width: 160px; height: 80px; background: linear-gradient(180deg, #d8c79a, #b89a6e); border-radius: 3px; box-shadow: inset 0 0 16px rgba(90,46,34,0.35); }
.mn-villa-windows { position: absolute; inset: 12px 18px 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; }
.mn-win { border-radius: 2px; background: #ffcf6a; box-shadow: 0 0 10px rgba(255,207,106,0.85); animation: mnFlicker 4s ease-in-out infinite; }
.mn-win.dark { background: #4a3a2a; box-shadow: none; }
@keyframes mnFlicker { 0%, 100% { opacity: 0.92; } 45% { opacity: 0.7; } 70% { opacity: 1; } }
.mn-villa-door { position: absolute; left: 50%; bottom: 0; width: 26px; height: 38px; transform: translateX(-50%); background: #5a3a1c; border-radius: 13px 13px 0 0; box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
.mn-villa-flag { position: absolute; left: 50%; bottom: 144px; width: 2px; height: 30px; background: #3a2a1a; transform: translateX(-50%); z-index: 3; }
.mn-villa-flag i { position: absolute; top: 0; left: 2px; width: 22px; height: 13px; background: #c44; clip-path: polygon(0 0, 100% 0, 80% 50%, 100% 100%, 0 100%); animation: mnWave 2.5s ease-in-out infinite; transform-origin: left; }
@keyframes mnWave { 0%, 100% { transform: skewY(0deg); } 50% { transform: skewY(-6deg); } }
.mn-villa-hedge { position: absolute; left: 0; right: 0; bottom: 0; height: 28px; background: repeating-radial-gradient(circle at 14px 18px, #2c4a2e 0 12px, #234023 12px 16px); background-color: #1e3620; }
.mn-villa-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 7px; min-width: 0; }
.mn-villa-tag { font-size: 10px; letter-spacing: 1.6px; color: #ffd75e; align-self: flex-start; background: rgba(255,215,94,0.08); border: 1px solid #5a4a1c; padding: 3px 10px; border-radius: 999px; }
.mn-villa-body h2 { margin: 2px 0; font-family: Georgia, serif; font-size: 27px; color: #f3e9d2; }
.mn-villa-body p { margin: 0 0 6px; color: #9b8fb8; font-size: 13.5px; line-height: 1.5; max-width: 540px; }
.mn-wing-title { font-family: Georgia, serif; color: #cbb8e8; font-size: 16px; margin: 4px 2px 12px; letter-spacing: 0.5px; }
@media (max-width: 680px) { .mn-villa { flex-direction: column; align-items: center; } .mn-villa-scene { width: 100%; max-width: 320px; } .mn-villa-body { align-items: center; text-align: center; } .mn-villa-tag { align-self: center; } }

/* ===== Quartermaster = the command post (2.4) ===== */
.qm { max-width: 940px; margin: 0 auto; }
.qm-head { margin-bottom: 14px; }
.qm-tag { font-size: 10px; letter-spacing: 1.6px; color: #ffd75e; background: rgba(255,215,94,0.08); border: 1px solid #5a4a1c; padding: 3px 10px; border-radius: 999px; }
.qm-head h2 { margin: 8px 0 4px; font-family: Georgia, serif; font-size: 24px; color: #f3e9d2; }
.qm-head p { margin: 0; color: #9b8fb8; font-size: 13px; max-width: 640px; }
.qm-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; border-bottom: 1px solid #2a2440; padding-bottom: 12px; }
.qm-tabs button { background: #11101e; border: 1px solid #2a2440; color: #b6a7d4; border-radius: 9px; padding: 7px 14px; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.qm-tabs button.on { background: #2a2360; border-color: #6a5a9a; color: #fff; }
.qm-tabs button:hover:not(.on) { border-color: #6a5a9a; }
.qm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 22px; }
.qm-stat { background: linear-gradient(180deg, #15102a, #0d0a18); border: 1px solid #2a2440; border-radius: 12px; padding: 16px; text-align: center; }
.qm-stat b { display: block; font-family: Georgia, serif; font-size: 30px; color: #7fe9ff; }
.qm-stat span { color: #8a7bb0; font-size: 11.5px; }
.qm-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 11px; margin-top: 8px; }
.qm-link { display: flex; align-items: center; gap: 12px; background: #11101e; border: 1px solid #2a2440; border-radius: 11px; padding: 12px 14px; text-decoration: none; transition: border-color 0.14s, transform 0.14s; }
.qm-link:hover { border-color: #46c8e0; transform: translateY(-2px); }
.qm-link-ico { font-size: 24px; }
.qm-link-t { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.qm-link-t strong { color: #eee6ff; font-size: 13.5px; }
.qm-link-t span { color: #8a7bb0; font-size: 11px; }
.qm-link-go { color: #46c8e0; font-size: 15px; }
.qm-body .px-admin { position: static; transform: none; width: 100%; margin: 0; }
.qm-body .pm-disk { padding: 0; }

/* markdown inside chat bubbles (2.5) */
.ch-md { color: #e8eef8; font-size: 13px; line-height: 1.5; word-break: break-word; }
.ch-md > :first-child { margin-top: 0; }
.ch-md > :last-child { margin-bottom: 0; }
.ch-md p { margin: 0 0 7px; }
.ch-md a { color: #7fd9ea; text-decoration: underline; }
.ch-md a:hover { color: #cfeff7; }
.ch-md code { background: rgba(0,0,0,0.35); border: 1px solid #2a3550; border-radius: 4px; padding: 1px 5px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: #cfe2f2; }
.ch-md pre { background: #05070c; border: 1px solid #1c2438; border-radius: 8px; padding: 10px; overflow-x: auto; margin: 7px 0; }
.ch-md pre code { background: none; border: none; padding: 0; color: #9fe6c0; }
.ch-md ul, .ch-md ol { margin: 6px 0; padding-left: 20px; }
.ch-md li { margin: 2px 0; }
.ch-md h1, .ch-md h2, .ch-md h3, .ch-md h4 { margin: 8px 0 4px; font-size: 14px; color: #f3e9d2; font-family: Georgia, serif; }
.ch-md blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid #443a7e; color: #b6a7d4; }
.ch-md table { border-collapse: collapse; margin: 7px 0; font-size: 12px; }
.ch-md th, .ch-md td { border: 1px solid #2a3550; padding: 4px 8px; }
.ch-md img { max-width: 100%; border-radius: 6px; }
.ch-msg.mine .ch-md code { background: rgba(0,0,0,0.3); }

/* ===== painted tavern hero (3.0) ===== */
.pt-room { position: relative; overflow: hidden; background: #0a0712; }
.pt-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(6,4,12,0.5) 100%); }
.pt-ch { position: absolute; bottom: 0; height: auto; pointer-events: none; filter: drop-shadow(0 8px 14px rgba(0,0,0,0.45)); will-change: transform; }
@keyframes ptbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.1%); } }
.pt-orc { left: 30%; bottom: 4%; height: 64%; animation: ptbob 4.6s ease-in-out infinite; }
.pt-dwarf { left: 6.5%; bottom: 3%; height: 45%; animation: ptbob 5.4s ease-in-out infinite 0.6s; }
.pt-elf { position: relative; height: 100%; bottom: auto; left: auto; display: block; }

/* the roster board */
.pt-board { position: absolute; left: 31%; top: 5%; width: 38%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 14px; cursor: pointer; font-family: inherit; color: #cdeeff;
  background: linear-gradient(180deg, rgba(8,34,58,0.82), rgba(6,20,40,0.82)); border: 1.5px solid #46c8e0; border-radius: 12px;
  box-shadow: 0 0 22px rgba(70,200,235,0.4), inset 0 0 26px rgba(70,200,235,0.14); backdrop-filter: blur(2px);
  background-image: repeating-linear-gradient(0deg, rgba(127,233,255,0.05) 0 1px, transparent 1px 3px); transition: transform 0.16s, box-shadow 0.16s; z-index: 4; }
.pt-board:hover { transform: translateY(-2px); box-shadow: 0 0 32px rgba(70,200,235,0.6), inset 0 0 26px rgba(70,200,235,0.18); }
.pt-board-title { font-family: Georgia, serif; font-size: clamp(15px, 2vw, 22px); color: #9af0ff; text-shadow: 0 0 10px rgba(127,233,255,0.7); letter-spacing: 0.5px; }
.pt-board-stats { display: flex; gap: 14px; font-size: clamp(9px, 1.1vw, 12px); color: #bfe6f5; }
.pt-board-stats b { color: #fff; font-size: 1.25em; }
.pt-board-muted { color: #6f93a8; }
.pt-board-cta { font-size: clamp(9px, 1.1vw, 12px); color: #ffd75e; }

/* the elf host + her held bubble */
.pt-elf-wrap { position: absolute; right: 1.5%; bottom: 0; height: 86%; aspect-ratio: 463 / 760; padding: 0; border: 0; background: none; cursor: pointer; z-index: 5; animation: ptbob 5.8s ease-in-out infinite 0.3s; }
.pt-elf-wrap:hover .pt-elf { filter: drop-shadow(0 0 16px rgba(127,233,255,0.5)); }
.pt-elf-bub { position: absolute; top: 4.5%; left: 1%; width: 45%; height: 20%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-align: center; color: #06283c; padding: 4px; }
.pt-elf-bub b { font-size: clamp(8px, 1.05vw, 12px); color: #06324a; }
.pt-elf-bub i { font-size: clamp(7px, 0.95vw, 11px); font-style: normal; color: #0d4a6e; }
.pt-elf-bub em { font-size: clamp(7px, 0.9vw, 10px); font-style: normal; color: #1d6e9e; }

/* floating wood sign bubbles */
.pt-bub { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 11px; border-radius: 10px; cursor: pointer; font-family: inherit; text-align: left; z-index: 6;
  background: linear-gradient(180deg, #241509f2, #170d05f2); border: 2px solid #8a5a32; box-shadow: 0 4px 0 rgba(0,0,0,0.4), 0 10px 22px rgba(0,0,0,0.5); transition: transform 0.15s; max-width: 30%; }
.pt-bub:hover { transform: translateY(-3px); border-color: #ffd75e; }
.pt-bub strong { color: #ffd75e; font-size: clamp(10px, 1.2vw, 13px); }
.pt-bub span { color: #f3e3c2; font-size: clamp(9px, 1.05vw, 12px); line-height: 1.3; }
.pt-bub-tail { position: absolute; left: 26px; bottom: -7px; width: 12px; height: 12px; background: #170d05; border-right: 2px solid #8a5a32; border-bottom: 2px solid #8a5a32; transform: rotate(45deg); }
.pt-bub-orc { left: 33%; top: 30%; animation: ptbob 4.6s ease-in-out infinite; }
.pt-bub-dwarf { left: 2%; top: 40%; animation: ptbob 5.4s ease-in-out infinite 0.6s; }

/* side passages */
.pt-tab { position: absolute; padding: 7px 13px; border-radius: 10px; cursor: pointer; font-family: Georgia, serif; font-size: clamp(11px, 1.3vw, 14px); color: #f3e9d2; z-index: 6;
  background: linear-gradient(180deg, #2a1d4ef0, #170f2cf0); border: 1.5px solid #6a5a9a; box-shadow: 0 4px 14px rgba(0,0,0,0.5); transition: transform 0.15s, border-color 0.15s; }
.pt-tab:hover { transform: translateY(-2px); border-color: #ffd75e; }
.pt-tab-legion { left: 3%; top: 7%; }
.pt-tab-mansion { right: 3%; top: 7%; }

@media (max-width: 700px) {
  .pt-bub { max-width: 38%; padding: 5px 8px; }
  .pt-board { width: 46%; padding: 8px; }
  .pt-bub-dwarf { display: none; }
}

/* painted hero: ambient life + mobile (3.1) */
.pt-ambient { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; z-index: 1; }
.pt-glow { position: absolute; border-radius: 50%; filter: blur(8px); }
.pt-glow.warm { background: radial-gradient(circle, rgba(255,180,90,0.55), rgba(255,170,80,0) 70%); }
.pt-glow.cool { background: radial-gradient(circle, rgba(90,200,255,0.5), rgba(70,200,235,0) 70%); }
@keyframes ptFlicker { 0%, 100% { opacity: 0.85; } 42% { opacity: 0.6; } 55% { opacity: 1; } 70% { opacity: 0.72; } }
@keyframes ptPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.95; } }
.pt-glow.a { left: 6%; top: 12%; width: 13%; aspect-ratio: 1; animation: ptFlicker 3.3s ease-in-out infinite; }
.pt-glow.b { left: 80%; top: 13%; width: 13%; aspect-ratio: 1; animation: ptFlicker 3.9s ease-in-out infinite 0.7s; }
.pt-glow.c { left: 9%; top: 36%; width: 12%; aspect-ratio: 1; animation: ptPulse 4.5s ease-in-out infinite; }
.pt-glow.d { left: 44%; top: 56%; width: 22%; aspect-ratio: 2.4; border-radius: 40%; animation: ptPulse 5s ease-in-out infinite 0.5s; }

/* mobile tap CTAs under the scene (diegetic hotspots are too small to tap) */
.gm-cta-row { display: none; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.gm-cta-row .gm-cta-btn { font-size: 13px; padding: 9px 14px; }
@media (max-width: 700px) {
  .pt-tab, .pt-bub-orc, .pt-bub-dwarf { display: none; }
  .pt-board { left: 50%; transform: translateX(-50%); width: 64%; top: 6%; }
  .pt-board:hover { transform: translateX(-50%) translateY(-2px); }
  .pt-elf-wrap { height: 80%; right: 0; }
  .gm-cta-row { display: flex; }
  .gm-stage3 .gm-room { width: 100%; }
}

/* native web terminal (3.2) */
.pty { display: flex; flex-direction: column; gap: 8px; }
.pty-bar { display: flex; align-items: center; gap: 9px; }
.pty-title { color: #cfe2f2; font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; }
.pty-mode { margin-left: auto; color: #8a7bb0; font-size: 11px; }
.pty-screen { margin: 0; background: #05070c; border: 1px solid #1c2438; border-radius: 9px; padding: 12px; min-height: 260px; max-height: 50vh; overflow: auto; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.4; color: #cfe6d8; white-space: pre-wrap; word-break: break-word; outline: none; cursor: text; }
.pty-screen.on { border-color: #46c8e0; box-shadow: 0 0 0 1px #46c8e0, inset 0 0 18px rgba(70,200,235,0.06); }
.pty-screen.ro { cursor: default; }
.pty-hint { margin: 0; }
.pty-hint code { font-size: 11px; }

/* respect reduced-motion: still the painted scene + decorative loops (3.3) */
@media (prefers-reduced-motion: reduce) {
  .pt-ch, .pt-elf-wrap, .pt-bub-orc, .pt-bub-dwarf, .pt-glow,
  .gm-bub-float, .lg-sol.alive .lg-sol-fig, .ch-dot.online, .apb-life.on,
  .gm-cursor, .apb-merc, .mn-villa-star, .mn-win, .mn-villa-flag i,
  .cl-item, .reveal { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* painted host greeter on the sign-in gate (3.3) */
.gate-greeter { display: block; width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 10px; border: 2px solid #6a5a9a; box-shadow: 0 0 20px rgba(127,233,255,0.32); background-color: #15102a; background-image: url(/scene2d/painted/elf.webp); background-repeat: no-repeat; background-size: 240% auto; background-position: 50% 5%; }

/* ===== playable RPG tavern (4.0) ===== */
.rpg { position: relative; overflow: hidden; background: #0a0712; }
.rpg-canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.rpg-prompt { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); background: linear-gradient(180deg, #241509f2, #170d05f2); border: 2px solid #ffd75e; color: #f3e3c2; border-radius: 10px; padding: 7px 14px; font-size: clamp(12px, 1.5vw, 15px); white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,0.5); z-index: 5; }
.rpg-prompt b { display: inline-block; background: #ffd75e; color: #1c1204; border-radius: 5px; padding: 0 6px; margin-right: 6px; font-size: 0.85em; }
.rpg-dialog { position: absolute; left: 4%; right: 4%; bottom: 5%; background: linear-gradient(180deg, #1a1228f5, #0e0a18f5); border: 2px solid #6a5a9a; border-radius: 12px; padding: 12px 16px; z-index: 6; cursor: pointer; box-shadow: 0 8px 26px rgba(0,0,0,0.6); }
.rpg-dialog strong { color: #ffd75e; font-family: Georgia, serif; font-size: clamp(13px, 1.6vw, 16px); }
.rpg-dialog p { margin: 4px 0 6px; color: #e8eef8; font-size: clamp(12px, 1.5vw, 14.5px); line-height: 1.45; }
.rpg-dialog-x { color: #8a7bb0; font-size: 11px; }
.rpg-help { position: absolute; left: 10px; top: 8px; color: #cbb8e8; background: rgba(10,7,18,0.6); border: 1px solid #2a2440; border-radius: 8px; padding: 4px 9px; font-size: 11px; z-index: 5; pointer-events: none; }
.rpg-help b { color: #ffd75e; }
/* on-screen controls */
.rpg-pad { position: absolute; left: 14px; bottom: 14px; width: 132px; height: 132px; z-index: 7; display: none; }
.rpg-pad button { position: absolute; width: 44px; height: 44px; border-radius: 10px; background: rgba(42,36,64,0.82); border: 1.5px solid #6a5a9a; color: #cbb8e8; font-size: 16px; touch-action: none; user-select: none; }
.rpg-pad button:active { background: rgba(106,90,154,0.9); }
.rpg-up { left: 44px; top: 0; } .rpg-down { left: 44px; bottom: 0; } .rpg-left { left: 0; top: 44px; } .rpg-right { right: 0; top: 44px; }
.rpg-a { position: absolute; right: 16px; bottom: 26px; width: 60px; height: 60px; border-radius: 50%; background: rgba(255,215,94,0.9); border: 2px solid #fff3c4; color: #1c1204; font-weight: 700; font-size: 20px; z-index: 7; display: none; touch-action: none; }
.rpg-a:active { transform: scale(0.94); }
@media (pointer: coarse), (max-width: 760px) { .rpg-pad, .rpg-a { display: block; } .rpg-help { display: none; } }

/* online presence badge (4.1) */
.rpg-online { position: absolute; right: 10px; top: 8px; color: #9af0ff; background: rgba(10,7,18,0.6); border: 1px solid #1f4456; border-radius: 8px; padding: 4px 9px; font-size: 11px; z-index: 5; pointer-events: none; }

/* player name badge (4.2) */
.rpg-name { position: absolute; right: 10px; top: 34px; color: #cbb8e8; background: rgba(10,7,18,0.6); border: 1px solid #2a2440; border-radius: 8px; padding: 4px 9px; font-size: 11px; z-index: 5; cursor: pointer; font-family: inherit; }
.rpg-name b { color: #9af0ff; }
.rpg-name:hover { border-color: #6a5a9a; }
