/* BEBRUSY — Bebrus Vil. Strategy hub UI. */

:root {
  --void: #0e1620;
  --panel: #1a2430;
  --text: #f2f6fa;
  --muted: #9aafc0;
  --ember: #f0a030;
  --teal: #3ad4a0;
  --wood: #6b4226;
  --display: "Syne", sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

body.warren {
  height: 100dvh;
  overflow: hidden;
  background: #0a1018;
  color: var(--text);
  font-family: var(--body);
}

body.warren #field-canvas,
body.warren .vignette,
body.warren .depth-rail,
body.warren .foot,
body.warren .nav,
body.warren .burger,
body.warren .porter,
body.warren .city-copy {
  display: none !important;
}

body.warren h2 {
  font-style: normal;
  font-weight: 800;
}

/* ---- top bar: logo | spores | wallet ---- */

body.warren .top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(10, 16, 24, 0.55);
  border: 0;
  backdrop-filter: blur(8px);
}

body.warren .brand-text {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
}

body.warren .brand-text em {
  color: var(--teal);
  letter-spacing: 0.28em;
}

body.warren .mark {
  animation: none;
  filter: none;
  color: var(--ember);
}

.hud-res {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 10px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
}

.hud-res b {
  color: var(--ember);
  font-weight: 700;
}

.signal.keyhole,
body.warren .signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--ember);
  color: #1a1008;
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 0 #8a5010;
}

.signal.keyhole svg {
  width: 14px;
  height: 14px;
}

.signal.keyhole:hover,
body.warren .signal:hover {
  filter: brightness(1.08);
}

.signal .dot {
  display: none;
}

/* ---- map ---- */

.city-stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  background: #0a1018;
}

.city-world {
  position: absolute;
  inset: 0;
  cursor: grab;
}

.city-world:active {
  cursor: grabbing;
}

.city-board {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.city-board .city-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0a1018;
  pointer-events: none;
  user-select: none;
}

.city-hits {
  position: absolute;
  inset: 0;
}

/* Clickable labels — the sign IS the button */
.door.sign-door {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 108px;
  padding: 9px 16px 10px;
  border: 2px solid #2a180c !important;
  border-radius: 6px;
  background: linear-gradient(180deg, #9a6438, #5c381c) !important;
  box-shadow:
    0 3px 0 #1a1008,
    0 8px 18px rgba(0, 0, 0, 0.35) !important;
  color: #fff4e0;
  cursor: pointer;
  z-index: 3;
  appearance: none;
  -webkit-appearance: none;
  outline: none !important;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

.door.sign-door:focus,
.door.sign-door:focus-visible,
.door.sign-door:active {
  outline: none !important;
}

.door.sign-door b {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.door.sign-door em {
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 244, 224, 0.65);
}

.door.sign-door:hover,
.door.sign-door.on {
  transform: translate(-50%, -50%) scale(1.08);
  filter: brightness(1.12);
  box-shadow:
    0 4px 0 #1a1008,
    0 12px 24px rgba(0, 0, 0, 0.45) !important;
}

.door.sign-door.hub {
  z-index: 6;
  background: linear-gradient(180deg, #3ad4a0, #1a8a68) !important;
  border-color: #0a4030 !important;
  color: #061810;
  box-shadow:
    0 3px 0 #0a4030,
    0 8px 18px rgba(0, 0, 0, 0.35) !important;
}

.door.sign-door.hub em {
  color: rgba(6, 24, 16, 0.7);
}

.door.sign-door.hub:hover,
.door.sign-door.hub.on {
  box-shadow:
    0 4px 0 #0a4030,
    0 12px 24px rgba(58, 212, 160, 0.35) !important;
}

body.warren .disconnect {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #c8d4de;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

body.warren .disconnect[hidden] {
  display: none !important;
}

body.warren .disconnect:hover {
  color: #fff;
  border-color: rgba(255, 120, 100, 0.55);
  background: rgba(80, 20, 16, 0.55);
}

body.warren .top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.warren .twitter-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #c8d4de;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

body.warren .twitter-link:hover {
  color: #fff;
  border-color: rgba(58, 212, 160, 0.55);
}

.mature-tag {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}

#stake-hint {
  margin: 8px 0 12px;
  color: var(--muted);
}

/* ---- HUD ---- */

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

.city-hud > * {
  pointer-events: auto;
}

.leave-fab {
  position: absolute;
  left: 14px;
  top: 64px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: rgba(20, 28, 38, 0.92);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 0 #000;
}

.leave-fab[hidden] {
  display: none !important;
}

.city-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

body.warren.in-plaza .city-hint {
  content: "";
}

/* ---- chambers ---- */

.chamber {
  position: fixed;
  inset: 52px 0 0 0;
  z-index: 80;
  overflow: auto;
  background: #0e141c;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.chamber.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.chamber-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: #141c28;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chamber-bar p {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}

.chamber-bar .leave,
body.warren .ghost.leave {
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--display);
  font-weight: 800;
  font-size: 11px;
}

body.warren.in-chamber .city-stage {
  pointer-events: none;
}

body.warren.in-chamber .city-hud {
  opacity: 0;
  pointer-events: none;
}

body.warren .layer {
  padding-top: 28px;
  max-width: 1100px;
}

body.warren main {
  z-index: 48;
}

body.warren .prime {
  border-radius: 8px;
  background: var(--ember);
  color: #1a1008;
  font-family: var(--display);
  font-weight: 800;
  border: 0;
  box-shadow: 0 2px 0 #8a5010;
}

/* ---- Nest = staking room ---- */

.chamber[data-chamber="journal"] {
  background: #0a1018;
  overflow: hidden;
}

.chamber[data-chamber="journal"] .chamber-bar {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 20;
  width: auto;
  padding: 0;
  background: transparent;
  border: 0;
}

.chamber[data-chamber="journal"] .chamber-bar p {
  display: none;
}

.chamber[data-chamber="journal"] .layer {
  max-width: none;
  padding: 0;
  height: 100%;
}

.nest-room {
  position: relative;
  width: 100%;
  height: calc(100dvh - 52px);
  overflow: hidden;
  background: #0a1018;
}

.nest-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  pointer-events: none;
  filter: saturate(1.05) contrast(1.04);
}

.nest-peds {
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 4;
  display: flex;
  gap: clamp(72px, 14vw, 200px);
  transform: translate(-50%, -50%);
}

.ped {
  position: relative;
  width: min(160px, 28vw);
  padding: 18px 14px 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 28, 38, 0.72), rgba(8, 12, 18, 0.88));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    filter 0.15s ease;
}

.ped:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.ped:not(:disabled):hover {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.4);
}

.ped b {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ped em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.ped-glow {
  position: absolute;
  left: 50%;
  top: -28px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  transform: translateX(-50%);
  filter: blur(1px);
  opacity: 0.9;
}

.ped-glow.teal {
  background: radial-gradient(circle, #5ef0c0 0%, transparent 70%);
  box-shadow: 0 0 28px #3ad4a0;
}

.ped-glow.ember {
  background: radial-gradient(circle, #ffd070 0%, transparent 70%);
  box-shadow: 0 0 28px #f0a030;
}

.nest-dialog {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 6;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  width: min(720px, calc(100% - 28px));
  padding: 14px;
  border: 2px solid #2a2018;
  border-radius: 10px;
  background: linear-gradient(180deg, #f4e8d0, #e8d5b0);
  color: #1a1410;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
}

.nest-dialog .npc {
  width: 88px;
  height: 88px;
  overflow: hidden;
  border: 2px solid #3a2a18;
  border-radius: 8px;
  background: #0e1620;
}

.nest-dialog .npc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.npc-name {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #b42828;
}

.npc-line {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.35;
  color: #1a1410;
}

.npc-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.npc-choices button {
  padding: 8px 12px;
  border: 1px solid #3a2a18;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.35);
  color: #1a1410;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.npc-choices button:hover {
  background: #fff;
}

.nest-manage {
  position: absolute;
  inset: 52px 12px 12px;
  z-index: 8;
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(10, 16, 24, 0.92);
  backdrop-filter: blur(10px);
}

.nest-manage[hidden] {
  display: none !important;
}

.nest-manage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.nest-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.nest-stats > div {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.nest-stats span {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nest-stats b {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ember);
}

.nest-id {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.warren.nest-talking .nest-peds {
  opacity: 1;
}

body.warren.nest-managing .nest-dialog,
body.warren.nest-managing .nest-peds {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 720px) {
  .hud-res span {
    display: none;
  }

  .door.sign-door b {
    font-size: 11px;
  }

  .door.sign-door {
    min-width: 92px;
    padding: 8px 12px 9px;
  }

  .nest-peds {
    top: 40%;
    gap: 18px;
  }

  .ped {
    width: 42vw;
    padding: 14px 10px 10px;
  }

  .nest-dialog {
    grid-template-columns: 64px 1fr;
    bottom: 10px;
  }

  .nest-dialog .npc {
    width: 64px;
    height: 64px;
  }

  .nest-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
