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

body {
  background: #000;
  color: #e8e1d5;
  font-family: "Courier New", monospace;
  overflow: hidden;
}

button,
input {
  font-family: inherit;
}

.location-shell {
  min-height: 100vh;
  background: #000;
}

.location-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  box-sizing: border-box;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 176, 0, 0.22);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.location-kicker {
  margin: 0 0 4px;
  color: rgba(255, 176, 0, 0.56);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.location-title {
  margin: 0;
  color: #fff;
  font-size: 16px;
  letter-spacing: 3px;
  line-height: 1;
  text-transform: uppercase;
}

.location-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.location-status {
  color: rgba(232, 225, 213, 0.58);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.location-link {
  color: rgba(255, 176, 0, 0.72);
  font-size: 10px;
  letter-spacing: 2px;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.location-link:hover {
  color: #ffb000;
}

.audio-toggle {
  height: 28px;
  border: 1px solid rgba(120, 210, 255, 0.28);
  border-radius: 2px;
  background: rgba(2, 8, 10, 0.68);
  color: rgba(196, 235, 245, 0.76);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 0 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  border-color: rgba(120, 210, 255, 0.62);
  color: rgba(226, 250, 255, 0.95);
  outline: none;
}

.audio-toggle.is-on {
  border-color: rgba(255, 176, 0, 0.56);
  background: rgba(255, 176, 0, 0.13);
  color: #ffb000;
}

.audio-toggle.needs-tap {
  border-color: rgba(255, 176, 0, 0.42);
  color: rgba(255, 176, 0, 0.86);
}

.location {
  position: relative;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  isolation: isolate;
  background: #050505;
  user-select: none;
}

.location-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.location-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.56) 0%, rgba(0, 0, 0, 0.08) 34%, rgba(0, 0, 0, 0.55) 100%);
}

.graffiti-layer,
.spray-target-layer {
  position: absolute;
  inset: 0;
}

.graffiti-layer {
  z-index: 2;
  pointer-events: none;
}

.spray-target-layer {
  z-index: 7;
  pointer-events: none;
}

.spray-target-layer.active {
  pointer-events: auto;
}

.spray-target-layer.active::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.01);
}

.spray-target-layer.active.inside-zone {
  cursor: crosshair;
}

.graffiti-stroke-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  mix-blend-mode: normal;
}

.graffiti-stroke-shadow,
.graffiti-stroke-ink {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.graffiti-stroke-shadow {
  stroke: rgba(0, 0, 0, 0.22);
  stroke-width: calc(var(--graffiti-width, 5px) + 5px);
  filter: blur(1.5px);
}

.graffiti-stroke-ink {
  stroke: rgba(2, 2, 2, 0.74);
  stroke-width: var(--graffiti-width, 5px);
  filter: drop-shadow(0 0 1px rgba(190, 190, 180, 0.1));
}

.graffiti-stroke-svg.local .graffiti-stroke-ink {
  stroke: rgba(0, 0, 0, 0.86);
}

.graffiti-dot {
  position: absolute;
  width: var(--graffiti-dot-size, 5px);
  height: var(--graffiti-dot-size, 5px);
  transform: translate(-50%, -50%) rotate(var(--graffiti-dot-rotate, 0deg)) scaleY(0.6);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  filter: blur(0.7px);
  mix-blend-mode: normal;
}

.avatar-stage {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.avatar-layer-root {
  position: absolute;
  inset: 0;
}

.floor-zone {
  position: absolute;
  box-sizing: border-box;
  border: 1px dashed rgba(255, 176, 0, 0.16);
  background: rgba(255, 176, 0, 0.025);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.avatar-stage:hover .floor-zone {
  opacity: 1;
}

.hotspot {
  position: absolute;
  z-index: 8;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px;
  border: 1px solid rgba(255, 176, 0, 0.36);
  background: rgba(3, 3, 3, 0.5);
  color: rgba(255, 176, 0, 0.84);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.45;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.hotspot:not(.hotspot-board):hover,
.hotspot:not(.hotspot-board):focus-visible {
  outline: none;
  background: rgba(255, 176, 0, 0.12);
  border-color: rgba(255, 176, 0, 0.72);
}

.hotspot-left-wall,
.hotspot-back-wall,
.hotspot-right-wall {
  display: none;
}

.hotspot-subtitle {
  color: rgba(232, 225, 213, 0.5);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1.6px;
}

.location-apartment .hotspot {
  border-color: rgba(120, 220, 255, 0.32);
  background: rgba(0, 0, 0, 0.34);
  color: rgba(205, 242, 255, 0.86);
}

.location-apartment .hotspot:hover,
.location-apartment .hotspot:focus-visible {
  border-color: rgba(255, 176, 0, 0.66);
  background: rgba(255, 176, 0, 0.1);
  color: #ffcf62;
}

.apartment-poster-wall-display {
  position: absolute;
  left: 43.8%;
  top: 23.2%;
  z-index: 3;
  width: 14.8%;
  height: 16.2%;
  display: grid;
  place-items: center;
  pointer-events: none;
  transform: perspective(900px) rotateX(0deg);
}

.apartment-poster-wall-display img {
  max-width: 100%;
  max-height: 100%;
  border: 2px solid rgba(255, 176, 0, 0.3);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.46);
  object-fit: contain;
}

.enemy-layer {
  position: absolute;
  inset: 0;
  z-index: 17;
  pointer-events: none;
}

.enemy-block {
  position: absolute;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(120, 220, 255, 0.38);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(120, 220, 255, 0.12), rgba(255, 176, 0, 0.08)),
    rgba(0, 0, 0, 0.66);
  color: rgba(210, 244, 255, 0.9);
  cursor: pointer;
  letter-spacing: 2px;
  line-height: 1.2;
  pointer-events: auto;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.48), inset 0 0 22px rgba(120, 220, 255, 0.04);
}

.enemy-block::before {
  content: "";
  width: 28px;
  height: 18px;
  border: 1px solid rgba(120, 220, 255, 0.58);
  border-radius: 999px 999px 8px 8px;
  background: rgba(120, 220, 255, 0.1);
  box-shadow:
    -15px 6px 0 -8px rgba(255, 176, 0, 0.72),
    15px 6px 0 -8px rgba(255, 176, 0, 0.72),
    0 0 16px rgba(120, 220, 255, 0.16);
}

.enemy-block-img {
  display: block;
  max-width: 44px;
  max-height: 34px;
  object-fit: contain;
  pointer-events: none;
}

.enemy-block:hover,
.enemy-block:focus-visible {
  outline: none;
  border-color: rgba(150, 225, 255, 0.82);
  color: #d9f7ff;
  filter: drop-shadow(0 0 14px rgba(120, 220, 255, 0.2));
  transform: scale(1.035);
}

.enemy-block-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.enemy-block-status {
  display: block;
  color: rgba(255, 176, 0, 0.74);
  font-size: 8px;
}

.enemy-speech-bubble {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 3;
  box-sizing: border-box;
  display: block;
  width: min(250px, 26vw);
  min-width: 150px;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 246, 228, 0.72);
  border-radius: 12px;
  background: rgba(245, 236, 215, 0.94);
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  pointer-events: none;
  text-align: left;
  text-transform: none;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

.enemy-speech-bubble::after {
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(255, 246, 228, 0.72);
  border-bottom: 1px solid rgba(255, 246, 228, 0.72);
  background: rgba(245, 236, 215, 0.94);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.enemy-neutral {
  border-color: rgba(120, 220, 255, 0.34);
}

.enemy-ad-drone {
  animation: ad-drone-hover 3s ease-in-out infinite;
}

.hotspot-board {
  position: absolute;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-image: var(--hotspot-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: none;
  transform-origin: center;
  transition: filter 0.14s ease, transform 0.14s ease;
}

.hotspot-board:hover,
.hotspot-board:focus-visible {
  outline: none;
  border-color: transparent;
  background-color: transparent;
  background-image: var(--hotspot-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  filter: drop-shadow(0 0 12px rgba(255, 176, 0, 0.18));
  transform: scale(1.035);
  z-index: 14;
}

.hotspot-title {
  color: rgba(255, 176, 0, 0.9);
  font-size: 8px;
  letter-spacing: 2px;
  line-height: 1.25;
}

.hotspot-board .hotspot-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hotspot-board-notes {
  position: absolute;
  top: 30%;
  right: 8%;
  bottom: 10%;
  left: 14%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(255, 246, 228, 0.82);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.hotspot-board-note {
  display: -webkit-box;
  max-height: 28px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hotspot-board-empty {
  color: rgba(232, 225, 213, 0.38);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.fixture-sign {
  position: absolute;
  z-index: 16;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 118px;
  padding: 9px 11px;
  border: 1px solid rgba(120, 220, 255, 0.3);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.68);
  color: rgba(150, 225, 255, 0.88);
  cursor: pointer;
  text-align: left;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.46), inset 0 0 18px rgba(120, 220, 255, 0.025);
}

.fixture-sign:hover,
.fixture-sign:focus-visible {
  outline: none;
  background: rgba(40, 120, 150, 0.18);
  border-color: rgba(150, 225, 255, 0.74);
  color: #b8f0ff;
}

.fixture-main {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.15;
}

.fixture-sub {
  color: rgba(232, 225, 213, 0.48);
  font-size: 8px;
  letter-spacing: 1px;
  line-height: 1.2;
}

.fixture-vend {
  left: 8.6%;
  top: 36.5%;
  bottom: auto;
  min-width: 0;
  width: clamp(118px, 12vw, 168px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform-origin: bottom center;
  transition: filter 0.14s ease, transform 0.14s ease;
}

.fixture-vend:hover,
.fixture-vend:focus-visible {
  background: transparent;
  border-color: transparent;
  filter: drop-shadow(0 0 14px rgba(120, 220, 255, 0.24));
  transform: scale(1.035);
}

.fixture-vend-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.npc-speech-bubble {
  position: absolute;
  z-index: 210;
  box-sizing: border-box;
  display: none;
  width: min(280px, 30vw);
  padding: 10px 12px;
  border: 1px solid rgba(255, 246, 228, 0.72);
  border-radius: 12px;
  background: rgba(245, 236, 215, 0.94);
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.npc-speech-bubble.visible {
  display: block;
}

.npc-speech-bubble::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 100%;
  width: 10px;
  height: 10px;
  transform: translateY(-5px) rotate(45deg);
  border-right: 1px solid rgba(255, 246, 228, 0.72);
  border-bottom: 1px solid rgba(255, 246, 228, 0.72);
  border-radius: 0 0 3px 0;
  background: rgba(245, 236, 215, 0.94);
}

.npc-speech-bubble a {
  color: #003b55;
  font-weight: 700;
  text-decoration: underline;
}

.npc-speech-bubble a:hover {
  color: #006f90;
}

.bartender-bubble {
  left: 34%;
  top: 26%;
  transform: translate(-50%, -100%);
}

.bartender-bubble::after {
  left: 50%;
  transform: translate(-50%, -5px) rotate(45deg);
}

.room-nav {
  box-sizing: border-box;
  border: 1px solid rgba(255, 176, 0, 0.34);
  border-left: 3px solid rgba(255, 176, 0, 0.78);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.76);
  color: rgba(255, 176, 0, 0.86);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 126px;
  padding: 9px 12px 9px 28px;
  position: absolute;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
  z-index: 15;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.46), inset 0 0 18px rgba(255, 176, 0, 0.025);
}

.room-nav::before {
  content: ">";
  position: absolute;
  left: 10px;
  top: 12px;
  color: #ffb000;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.room-nav:hover,
.room-nav:focus-visible {
  outline: none;
  background: rgba(255, 176, 0, 0.12);
  border-color: rgba(255, 176, 0, 0.72);
  color: #ffb000;
}

.room-nav-main {
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.15;
}

.room-nav-sub {
  color: rgba(232, 225, 213, 0.48);
  font-size: 8px;
  letter-spacing: 1px;
  line-height: 1.2;
}

.room-nav-sentinel {
  bottom: 18px;
  left: 18px;
}

.room-nav-sentinel::before {
  content: "<";
}

.room-nav-door {
  left: 27%;
  top: 32%;
  transform: translate(-50%, -100%);
}

.room-nav-door::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  height: 22px;
  border-left: 1px solid rgba(255, 176, 0, 0.7);
}

.location-sixth-street .location-bg {
  filter: contrast(1.06) saturate(0.72) brightness(0.64);
}

.location-sixth-street .location-vignette {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.18) 42%, rgba(0, 0, 0, 0.66) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.02) 48%, rgba(0, 0, 0, 0.4) 100%);
}

.location-sixth-street .room-nav-door {
  left: 13%;
  top: 78%;
}

.location-sixth-street .room-nav-door::after {
  display: none;
}

.location-sixth-street::after {
  content: "ADMIN STREET TEST";
  position: absolute;
  left: 24px;
  top: 74px;
  z-index: 3;
  color: rgba(255, 176, 0, 0.36);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  pointer-events: none;
}

.room-avatar {
  position: absolute;
  z-index: 40;
  width: clamp(56px, 7vw, 90px);
  transform: translate(-50%, -100%);
  cursor: grab;
  touch-action: none;
}

.room-avatar.is-self {
  z-index: 41;
}

.room-avatar.is-npc {
  width: clamp(62px, 7.5vw, 98px);
  cursor: pointer;
}

.room-avatar.is-npc .avatar-stack {
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.78)) drop-shadow(0 0 10px rgba(255, 176, 0, 0.12));
}

/* Players: slightly lower opacity and gentle shadow to match `seren` styling */
.room-avatar:not(.is-npc) .avatar-stack {
  opacity: 0.88;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 10px rgba(120, 220, 255, 0.08)) grayscale(0.18) contrast(1.08) brightness(0.82);
}

.room-avatar.is-npc-image {
  cursor: pointer;
}

.npc-image-wrap {
  position: relative;
  width: 100%;
  pointer-events: none;
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.82));
}

.npc-image-wrap::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 8%;
  bottom: 3%;
  z-index: -1;
  height: 10%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  filter: blur(10px);
  transform: skewX(-16deg);
}

.npc-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.npc-seren {
  width: clamp(54px, 7vw, 176px);
}

.npc-seren .npc-image-wrap {
  animation: seren-glitch 11s infinite;
}

.npc-seren .npc-image {
  opacity: 0.88;
  mix-blend-mode: multiply;
  filter: grayscale(0.18) contrast(1.08) brightness(0.82) drop-shadow(0 0 10px rgba(120, 220, 255, 0.08));
}

.room-avatar.dragging {
  cursor: grabbing;
}

.avatar-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 500 / 1023;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.72));
}

.avatar-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.avatar-base-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.avatar-base-wrap > .avatar-layer {
  position: static;
}

.avatar-skin {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;
  pointer-events: none;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.avatar-lips {
  z-index: 2;
  transform-origin: 50% 38%;
}

.avatar-hair,
.avatar-underwearTop,
.avatar-underwearBottom,
.avatar-pants,
.avatar-top,
.avatar-shoes {
  z-index: 3;
}

/* Split hat rendering: bottom part renders under the mannequin, top above hair/patch. */
.avatar-hat-bottom {
  z-index: 1;
}
.avatar-hat-top {
  z-index: 5;
}

.avatar-patch-mask {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.avatar-patch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transform-origin: 0 0;
}

.room-avatar-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 4px);
  max-width: 112px;
  transform: translateX(-50%);
  padding: 3px 6px;
  border: 1px solid rgba(0, 0, 0, 0.58);
  background: rgba(0, 0, 0, 0.72);
  color: rgba(255, 246, 228, 0.82);
  font-size: 9px;
  letter-spacing: 1px;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}

.room-avatar.is-self .room-avatar-name {
  border-color: rgba(255, 176, 0, 0.55);
  color: #ffb000;
}

.room-avatar.is-npc .room-avatar-name {
  appearance: none;
  top: auto;
  bottom: calc(100% + 6px);
  z-index: 5;
  max-width: 132px;
  border-color: rgba(120, 220, 255, 0.42);
  color: rgba(184, 240, 255, 0.9);
  cursor: pointer;
  font-size: 9px;
  box-shadow: 0 0 10px rgba(120, 220, 255, 0.08);
}

.room-avatar.is-npc .room-avatar-name:hover,
.room-avatar.is-npc .room-avatar-name:focus-visible {
  outline: none;
  border-color: rgba(150, 225, 255, 0.8);
  color: #b8f0ff;
}

.room-avatar-name a,
.room-avatar-name span {
  color: inherit;
  text-decoration: none;
}

.room-avatar-hp {
  position: absolute;
  left: 50%;
  top: calc(100% + 24px);
  transform: translateX(-50%);
  max-width: 96px;
  border: 1px solid rgba(120, 220, 255, 0.26);
  background: rgba(0, 0, 0, 0.58);
  color: rgba(184, 240, 255, 0.78);
  font-size: 8px;
  letter-spacing: 1px;
  line-height: 1;
  padding: 3px 5px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.speech-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  box-sizing: border-box;
  width: max-content;
  max-width: 220px;
  transform: translateX(-50%);
  padding: 9px 11px;
  border: 1px solid rgba(255, 246, 228, 0.72);
  border-radius: 12px;
  background: rgba(245, 236, 215, 0.94);
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -5px) rotate(45deg);
  border-right: 1px solid rgba(255, 246, 228, 0.72);
  border-bottom: 1px solid rgba(255, 246, 228, 0.72);
  border-radius: 0 0 3px 0;
  background: rgba(245, 236, 215, 0.94);
}

.speech-input {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(180px, 420px) 78px;
  gap: 8px;
  width: min(560px, calc(100vw - 28px));
  transform: translateX(-50%);
}

.speech-input input {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255, 176, 0, 0.3);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.78);
  color: rgba(255, 246, 228, 0.88);
  font-size: 13px;
  outline: none;
  padding: 0 12px;
}

.speech-input input:focus {
  border-color: rgba(255, 176, 0, 0.78);
}

.speech-input button,
.signin-button,
.board-close,
.board-note-form button {
  height: 42px;
  border: 1px solid rgba(255, 176, 0, 0.72);
  border-radius: 2px;
  background: rgba(255, 176, 0, 0.88);
  color: #050505;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.speech-input button:hover,
.signin-button:hover,
.board-close:hover,
.board-note-form button:hover {
  background: #ffb000;
}

.speech-input button:disabled,
.board-note-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.location-message {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 220;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 176, 0, 0.32);
  background: rgba(0, 0, 0, 0.84);
  padding: 22px;
  color: rgba(232, 225, 213, 0.72);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.location-message h2 {
  margin: 0 0 10px;
  color: #ffb000;
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.location-message-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.location-message-btn {
  border: 1px solid rgba(255, 176, 0, 0.42);
  border-radius: 2px;
  background: rgba(255, 176, 0, 0.08);
  color: rgba(255, 176, 0, 0.88);
  cursor: pointer;
  font: 700 9px "Courier New", monospace;
  letter-spacing: 2px;
  padding: 8px 12px;
  text-decoration: none;
  text-transform: uppercase;
}

.location-message-btn.primary {
  background: rgba(255, 176, 0, 0.84);
  color: #090909;
}

.board-panel,
.vend-panel {
  position: absolute;
  right: 18px;
  top: 74px;
  z-index: 18;
  box-sizing: border-box;
  width: min(390px, calc(100vw - 36px));
  max-height: calc(100vh - 110px);
  overflow: auto;
  border: 1px solid rgba(255, 176, 0, 0.34);
  background: rgba(0, 0, 0, 0.86);
  padding: 18px;
  display: none;
}

.vend-panel {
  /* Make vend panel sit above everything and remain fixed in viewport */
  position: fixed;
  z-index: 10000;
  left: 18px;
  right: auto;
  top: 74px;
  width: min(420px, calc(100vw - 36px));
  box-sizing: border-box;
  max-height: calc(100vh - 110px);
  display: none;
  padding: 18px;
  overflow: auto;
  /* Use flex layout when opened so inner content and the close button can be arranged */
  flex-direction: column;
}

.board-panel.open {
  display: block;
}
.vend-panel.open {
  display: flex;
}

/* Vend backdrop dims and captures clicks while vend panel is open */
.vend-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.46);
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: auto;
}
.vend-backdrop.visible {
  opacity: 1;
}

.board-panel h2,
.vend-panel h2 {
  margin: 0 0 10px;
  color: #ffb000;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.board-panel p,
.vend-panel p {
  margin: 0 0 14px;
  color: rgba(232, 225, 213, 0.58);
  font-size: 12px;
  line-height: 1.6;
}

.vend-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 176, 0, 0.12);
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.vend-panel-head h2,
.vend-panel-head p {
  margin-bottom: 0;
}

.vend-balance {
  flex-shrink: 0;
  border: 1px solid rgba(120, 220, 255, 0.24);
  color: rgba(150, 225, 255, 0.88);
  font-size: 9px;
  letter-spacing: 2px;
  padding: 6px 8px;
  text-transform: uppercase;
}

.vend-balance b {
  color: #b8f0ff;
  font-size: 12px;
}

.vend-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* Ensure vend items area scrolls and doesn't get hidden behind the close button */
.vend-panel .vend-items {
  flex: 1 1 auto;
  overflow: auto;
  padding-bottom: 72px; /* room for the floating close button */
}

.vend-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 176, 0, 0.15);
  background: rgba(255, 255, 255, 0.035);
  padding: 9px;
}

.vend-thumb-frame {
  width: 54px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 176, 0, 0.08);
  background: rgba(0, 0, 0, 0.45);
}

.vend-thumb {
  width: 54px;
  height: 64px;
  object-fit: contain;
  transform: translate(var(--thumb-x, 0%), var(--thumb-y, 0%)) scale(var(--thumb-scale, 1));
  transform-origin: center;
}

.vend-item-title {
  margin: 0 0 4px;
  color: rgba(255, 246, 228, 0.86);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.vend-item-desc {
  margin: 0;
  color: rgba(232, 225, 213, 0.43);
  font-size: 10px;
  line-height: 1.45;
}

.vend-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.vend-price {
  color: rgba(255, 176, 0, 0.75);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.vend-buy,
.vend-close {
  border: 1px solid rgba(255, 176, 0, 0.45);
  border-radius: 2px;
  background: rgba(255, 176, 0, 0.12);
  color: rgba(255, 176, 0, 0.9);
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 9px;
  letter-spacing: 2px;
  padding: 6px 10px;
  text-transform: uppercase;
}

.vend-buy:hover,
.vend-close:hover {
  border-color: rgba(255, 176, 0, 0.86);
  background: rgba(255, 176, 0, 0.2);
}

/* Float the close button so it stays visible at the bottom of the panel */
.vend-panel .vend-close {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 10001;
  width: calc(100% - 36px);
}

.vend-buy:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  color: rgba(232, 225, 213, 0.25);
  cursor: not-allowed;
}

.vend-status {
  min-height: 14px;
  color: rgba(232, 225, 213, 0.45);
  font-size: 10px;
  letter-spacing: 1px;
}

.vend-status.ok {
  color: rgba(100, 220, 100, 0.85);
}

.vend-status.err {
  color: rgba(255, 100, 100, 0.9);
}

.apartment-panel {
  position: absolute;
  left: 18px;
  top: 74px;
  z-index: 90;
  box-sizing: border-box;
  width: min(440px, calc(100vw - 36px));
  max-height: calc(100vh - 110px);
  overflow: auto;
  display: none;
  border: 1px solid rgba(120, 220, 255, 0.34);
  background: rgba(0, 0, 0, 0.88);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  padding: 18px;
}

.poster-panel {
  left: auto;
  right: 18px;
}

.apartment-panel.open {
  display: block;
}

.apartment-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(120, 220, 255, 0.14);
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.apartment-panel h2 {
  margin: 0 0 8px;
  color: rgba(205, 242, 255, 0.95);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.apartment-panel p {
  margin: 0;
  color: rgba(232, 225, 213, 0.56);
  font-size: 11px;
  line-height: 1.55;
}

.apartment-panel-link {
  flex-shrink: 0;
  border: 1px solid rgba(255, 176, 0, 0.36);
  color: rgba(255, 176, 0, 0.84);
  font-size: 8px;
  letter-spacing: 2px;
  padding: 6px 8px;
  text-decoration: none;
  text-transform: uppercase;
}

.closet-items,
.closet-section {
  display: grid;
  gap: 12px;
}

.closet-section h3 {
  margin: 0;
  color: rgba(255, 176, 0, 0.62);
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

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

.closet-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(120, 220, 255, 0.13);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

.closet-thumb {
  width: 44px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(120, 220, 255, 0.11);
  background: rgba(0, 0, 0, 0.36);
}

.closet-thumb img {
  width: 44px;
  height: 48px;
  object-fit: contain;
  transform: translate(var(--thumb-x, 0%), var(--thumb-y, 0%)) scale(var(--thumb-scale, 1));
  transform-origin: center;
}

.closet-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.closet-copy b {
  color: rgba(255, 246, 228, 0.85);
  font-size: 10px;
  letter-spacing: 1.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.closet-copy em,
.closet-empty {
  color: rgba(232, 225, 213, 0.38);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.closet-badge {
  border: 1px solid rgba(255, 176, 0, 0.28);
  color: rgba(255, 176, 0, 0.72);
  font-size: 8px;
  letter-spacing: 1.5px;
  padding: 4px 6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.poster-preview {
  min-height: 220px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(120, 220, 255, 0.18);
  background: rgba(3, 8, 10, 0.62);
  color: rgba(232, 225, 213, 0.36);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.poster-preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.poster-warning {
  border: 1px solid rgba(255, 176, 0, 0.18);
  background: rgba(255, 176, 0, 0.05);
  margin-bottom: 12px !important;
  padding: 10px;
}

.poster-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.poster-form input {
  min-width: 0;
  color: rgba(232, 225, 213, 0.62);
  font-size: 10px;
}

.poster-form button,
.apartment-panel-close {
  border: 1px solid rgba(120, 220, 255, 0.34);
  border-radius: 2px;
  background: rgba(120, 220, 255, 0.09);
  color: rgba(205, 242, 255, 0.86);
  cursor: pointer;
  font: 700 9px "Courier New", monospace;
  letter-spacing: 2px;
  padding: 8px 10px;
  text-transform: uppercase;
}

.apartment-panel-close {
  width: 100%;
  margin-top: 14px;
}

.poster-status {
  min-height: 16px;
  margin-top: 10px !important;
  color: rgba(232, 225, 213, 0.46) !important;
  font-size: 10px !important;
  letter-spacing: 1px;
}

.poster-status.ok {
  color: rgba(100, 220, 100, 0.86) !important;
}

.poster-status.err {
  color: rgba(255, 100, 100, 0.9) !important;
}

.location-inventory {
  position: absolute;
  right: 18px;
  bottom: 76px;
  z-index: 19;
  box-sizing: border-box;
  width: min(240px, calc(100vw - 36px));
  border: 1px solid rgba(120, 220, 255, 0.28);
  background: rgba(0, 0, 0, 0.78);
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.46);
}

.location-inventory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.location-inventory h2 {
  margin: 0;
  color: rgba(150, 225, 255, 0.9);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

#sprayTimer {
  min-height: 12px;
  color: rgba(255, 176, 0, 0.88);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.location-inventory-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.location-inventory-empty {
  color: rgba(232, 225, 213, 0.35);
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 1.4;
  text-transform: uppercase;
}

.location-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 52px;
  border: 1px solid rgba(120, 220, 255, 0.22);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  padding: 0;
}

.location-item:hover,
.location-item:focus-visible,
.location-item.selected {
  outline: none;
  border-color: rgba(150, 225, 255, 0.74);
  background: rgba(120, 220, 255, 0.08);
}

.location-item img {
  display: block;
  max-width: 34px;
  max-height: 42px;
  object-fit: contain;
  pointer-events: none;
}

.location-item-count {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 176, 0, 0.56);
  border-radius: 999px;
  background: #050505;
  color: rgba(255, 176, 0, 0.9);
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.location-inventory-action {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(120, 220, 255, 0.14);
  padding-top: 10px;
}

.location-inventory-action.open {
  display: flex;
}

.location-inventory-action span {
  min-width: 0;
  color: rgba(232, 225, 213, 0.6);
  font-size: 10px;
  letter-spacing: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.location-inventory-action button {
  flex-shrink: 0;
  border: 1px solid rgba(255, 176, 0, 0.55);
  border-radius: 2px;
  background: rgba(255, 176, 0, 0.14);
  color: rgba(255, 176, 0, 0.9);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 6px 9px;
  text-transform: uppercase;
}

.location-inventory-action button:hover {
  border-color: rgba(255, 176, 0, 0.86);
  background: rgba(255, 176, 0, 0.22);
}

.location-inventory-action button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.location-inventory-status {
  min-height: 13px;
  margin: 8px 0 0;
  color: rgba(232, 225, 213, 0.42);
  font-size: 10px;
  letter-spacing: 1px;
  line-height: 1.35;
}

.location-inventory-status.ok {
  color: rgba(100, 220, 100, 0.85);
}

.location-inventory-status.err {
  color: rgba(255, 100, 100, 0.9);
}

.combat-panel {
  position: absolute;
  left: 18px;
  bottom: 76px;
  z-index: 19;
  box-sizing: border-box;
  width: min(320px, calc(100vw - 36px));
  border: 1px solid rgba(255, 176, 0, 0.28);
  background: rgba(0, 0, 0, 0.84);
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.46);
  opacity: 1;
  transition: opacity 3.6s ease, transform 0.24s ease;
}

.combat-panel.is-fading {
  opacity: 0;
  pointer-events: none;
}

.combat-panel[hidden] {
  display: none;
}

.combat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.combat-panel h2 {
  margin: 0;
  color: rgba(255, 176, 0, 0.92);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.combat-self {
  border: 1px solid rgba(255, 176, 0, 0.12);
  background: rgba(255, 255, 255, 0.025);
  padding: 7px;
}

.combat-self-top,
.combat-self-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(232, 225, 213, 0.66);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.combat-meter {
  height: 5px;
  margin: 7px 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.combat-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(180, 60, 60, 0.88), rgba(255, 176, 0, 0.82));
}

.combat-status-line {
  min-height: 13px;
  margin-top: 7px;
  color: rgba(150, 225, 255, 0.82);
  font-size: 10px;
  line-height: 1.35;
}

.combat-status-line.is-error {
  color: rgba(255, 100, 100, 0.9);
}

.combat-self-gear {
  margin-top: 5px;
  color: rgba(232, 225, 213, 0.45);
  font-size: 9px;
  letter-spacing: 1px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.combat-targets {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.combat-target-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(120, 220, 255, 0.24);
  border-radius: 2px;
  background: rgba(120, 220, 255, 0.045);
  padding: 8px;
}

.combat-target-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(232, 225, 213, 0.78);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.combat-target-card-head strong {
  min-width: 0;
  overflow: hidden;
  color: rgba(184, 240, 255, 0.92);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-target-card-head span {
  flex-shrink: 0;
  color: rgba(255, 176, 0, 0.82);
}

.combat-target-meter {
  margin: 0;
}

.combat-target-meta {
  display: grid;
  gap: 3px;
  color: rgba(232, 225, 213, 0.48);
  font-size: 9px;
  letter-spacing: 1px;
  line-height: 1.3;
  text-transform: uppercase;
}

.combat-loot-hint {
  border: 1px solid rgba(120, 220, 255, 0.18);
  background: rgba(120, 220, 255, 0.06);
  color: rgba(184, 240, 255, 0.82);
  font-size: 9px;
  letter-spacing: 1.2px;
  padding: 6px;
  text-align: center;
  text-transform: uppercase;
}

.combat-target-row {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(120, 220, 255, 0.22);
  border-radius: 2px;
  background: rgba(120, 220, 255, 0.045);
  padding: 7px;
}

.combat-target-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: rgba(232, 225, 213, 0.78);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 0;
  text-align: left;
  text-transform: uppercase;
}

.combat-target-row:hover {
  border-color: rgba(150, 225, 255, 0.5);
}

.combat-target-main:hover,
.combat-target-main:focus-visible {
  outline: none;
  color: #d9f7ff;
}

.combat-target-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-target-hp {
  flex-shrink: 0;
  color: rgba(255, 176, 0, 0.78);
}

.combat-target-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.combat-target-actions button {
  min-width: 0;
  border: 1px solid rgba(255, 176, 0, 0.28);
  border-radius: 2px;
  background: rgba(255, 176, 0, 0.08);
  color: rgba(255, 176, 0, 0.82);
  cursor: pointer;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  overflow: hidden;
  padding: 5px 4px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.combat-target-actions button:hover,
.combat-target-actions button:focus-visible {
  outline: none;
  border-color: rgba(255, 176, 0, 0.72);
  background: rgba(255, 176, 0, 0.14);
}

.combat-target-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.combat-log {
  display: grid;
  gap: 5px;
  max-height: 76px;
  margin: 9px 0 0;
  overflow: auto;
  padding: 0;
  list-style: none;
  color: rgba(232, 225, 213, 0.58);
  font-size: 10px;
  line-height: 1.35;
}

.combat-empty {
  margin: 0;
  color: rgba(232, 225, 213, 0.34);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.combat-notice-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.combat-action-button {
  height: 42px;
  min-width: 96px;
  border: 1px solid rgba(180, 60, 60, 0.78);
  border-radius: 2px;
  background: rgba(180, 60, 60, 0.88);
  color: rgba(255, 246, 228, 0.94);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.combat-action-button:hover {
  background: rgba(205, 70, 70, 0.95);
}

.combat-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.combat-loot-button {
  border-color: rgba(120, 220, 255, 0.6);
  background: rgba(120, 220, 255, 0.12);
  color: rgba(184, 240, 255, 0.94);
}

.combat-action-hint {
  color: rgba(232, 225, 213, 0.48);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.board-notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
}

.board-note {
  border: 1px solid rgba(255, 176, 0, 0.16);
  background: rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.board-note-body {
  margin: 0 0 8px;
  color: rgba(255, 246, 228, 0.84);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.board-note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(232, 225, 213, 0.38);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.board-note-meta a {
  color: rgba(255, 176, 0, 0.74);
  text-decoration: none;
}

.board-note-meta a:hover {
  color: #ffb000;
}

.board-notes-empty {
  border: 1px dashed rgba(255, 176, 0, 0.18);
  padding: 12px;
  color: rgba(232, 225, 213, 0.38);
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1.5;
  text-transform: uppercase;
}

.board-note-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}

.board-note-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid rgba(255, 176, 0, 0.24);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.72);
  color: rgba(255, 246, 228, 0.88);
  font: 12px/1.45 "Courier New", monospace;
  outline: none;
  padding: 10px;
}

.board-note-form textarea:focus {
  border-color: rgba(255, 176, 0, 0.72);
}

.board-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.board-note-status {
  min-height: 14px;
  color: rgba(232, 225, 213, 0.45);
  font-size: 10px;
  line-height: 1.4;
}

.board-note-status.ok {
  color: rgba(100, 220, 100, 0.85);
}

.board-note-status.err {
  color: rgba(255, 100, 100, 0.9);
}

@media (max-width: 700px) {
  .location-topbar {
    height: 64px;
    align-items: flex-start;
    padding: 9px 12px;
  }

  .location-title {
    font-size: 14px;
  }

  .location-status {
    display: none;
  }

  .avatar-stage {
    inset: 0;
  }

  .room-avatar {
    width: 58px;
  }

  .npc-seren {
    width: clamp(92px, 24vw, 132px);
  }

  .speech-input {
    grid-template-columns: minmax(0, 1fr) 70px;
    bottom: 12px;
  }

  .location-inventory {
    right: 12px;
    bottom: 72px;
    width: min(210px, calc(100vw - 24px));
  }

  .combat-panel {
    left: 12px;
    bottom: 132px;
    width: min(210px, calc(100vw - 24px));
  }

  .combat-log {
    max-height: 68px;
  }

  .room-nav {
    min-width: 112px;
    padding: 8px 10px 8px 24px;
  }

  .room-nav-sentinel {
    bottom: 66px;
    left: 12px;
  }

  .room-nav-door {
    left: 27%;
    top: 34%;
  }

  .fixture-vend {
    left: 7%;
    top: 37%;
    bottom: auto;
    width: clamp(88px, 20vw, 126px);
  }

  .vend-panel {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .apartment-panel,
  .poster-panel {
    left: 12px;
    right: 12px;
    top: 72px;
    width: auto;
  }

  .poster-form {
    grid-template-columns: 1fr;
  }

  .apartment-poster-wall-display {
    left: 41%;
    top: 24%;
    width: 19%;
    height: 14%;
  }

  .vend-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .vend-item-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .npc-speech-bubble {
    width: min(260px, calc(100vw - 28px));
  }

  .bartender-bubble {
    left: 16px;
    right: 16px;
    top: 20%;
  }
}

/* Avatar options menu */
.avatar-menu {
  position: absolute;
  z-index: 80;
  min-width: 140px;
  box-sizing: border-box;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid rgba(255,176,0,0.18);
  background: rgba(0, 0, 0, 0.92);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  transform-origin: top center;
}
.avatar-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #e8e1d5;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.avatar-menu button:hover { background: rgba(255,176,0,0.06); color: #ffb000; }

@keyframes seren-glitch {
  0%, 18%, 20%, 54%, 56%, 82%, 84%, 100% {
    opacity: 1;
    transform: translate(0, 0) skewX(0deg);
    filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.82));
  }
  18.4% {
    opacity: 0.72;
    transform: translate(-2px, 1px) skewX(-2deg);
    filter: drop-shadow(3px 0 0 rgba(120, 220, 255, 0.34)) drop-shadow(-2px 0 0 rgba(255, 0, 120, 0.22)) drop-shadow(0 18px 14px rgba(0, 0, 0, 0.82));
  }
  19% {
    opacity: 0.92;
    transform: translate(2px, -1px) skewX(2deg);
  }
  54.5% {
    opacity: 0.62;
    transform: translate(1px, 0) scaleX(0.985);
    filter: drop-shadow(-3px 0 0 rgba(255, 0, 120, 0.28)) drop-shadow(2px 0 0 rgba(120, 220, 255, 0.24)) drop-shadow(0 18px 14px rgba(0, 0, 0, 0.82));
  }
  83% {
    opacity: 0.78;
    transform: translate(-1px, -1px) skewX(1deg);
  }
}

@keyframes ad-drone-hover {
  0%, 100% {
    transform: translate(0, 0) rotate(-1deg);
  }
  15% {
    transform: translate(5px, -8px) rotate(3deg);
  }
  30% {
    transform: translate(-3px, -2px) rotate(-2deg);
  }
  45% {
    transform: translate(-7px, 5px) rotate(1deg);
  }
  60% {
    transform: translate(2px, 7px) rotate(-3deg);
  }
  75% {
    transform: translate(6px, -4px) rotate(2deg);
  }
  90% {
    transform: translate(-5px, -6px) rotate(-1deg);
  }
}
