: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 {
    display: flex; flex-direction: column; gap: 6px;
    position: absolute; top: 100%; right: 8px;
    padding: 8px; background: #1a0d05; border: 3px solid #000; z-index: 50;
  }
  .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-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 - 210px) * 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 hub) */
.mn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mn-card { grid-column: 1 / -1; padding: 18px; border-radius: 14px; background: #130d20; border: 1px solid #2a1f3e; }
.mn-card-wide { max-width: 720px; }
.mn-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mn-card-head strong { font-size: 17px; color: #fff; display: block; }
.mn-soon-ico { font-size: 26px; }
.mn-tag { font-size: 11px; color: #27d8ff; }
.mn-soon { padding: 18px; border-radius: 14px; background: #0e0a18; border: 1px dashed #2a1f3e; opacity: 0.6; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.mn-soon strong { color: #c9b8e6; } .mn-soon span { font-size: 12px; color: #7a6a98; }
.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 h5 { 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: #9a86b8; cursor: pointer; opacity: 0.8; 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; }
