/* labels_v1 — town map name plates (wood frame + parchment face) and the Settings gear.
   Shown always when body.names-on (Settings → Show building names, default ON);
   with names-off they fall back to the old hover / press / needs-you behavior. */
.pin .pin-name,
.boss-storm .map-plate {
  position: relative;
  z-index: 6;
  display: inline-block;
  margin-top: 0;
  top: 34%;
  padding: 2px 8px 3px;
  max-width: none;
  font-family: var(--serif, Georgia, serif);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  color: #3a2410;
  text-shadow: 0 1px 0 rgba(255, 245, 220, 0.6);
  background: linear-gradient(180deg, #f7e8c4 0%, #ecd6a2 100%);
  border: 2px solid #6e4520;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #3d2410, 0 2px 0 #3d2410, 0 3px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  pointer-events: none;
  transition: opacity 0.12s;
}
.pin .pin-name small {
  display: inline;
  margin-left: 4px;
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a5426;
  opacity: 1;
}
/* locked places: same plate, darker wood, padlock */
.pin.locked .pin-name.pin-locked-label {
  color: #f1dfb6;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #7b5530 0%, #5b3b1e 100%);
  border-color: #3b220e;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.72rem;
}
/* needs you: the plate gets a green wax edge instead of glowing text */
.pin.needs-you .pin-name,
.pin.needs-you .pin-attention-name {
  color: #24400f;
  text-shadow: 0 1px 0 rgba(255, 255, 230, 0.6);
  border-color: #3f7a26;
  box-shadow: 0 0 0 1px #234012, 0 2px 0 #234012, 0 0 10px rgba(120, 200, 90, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* ON (default): every plate visible */
body.names-on .pin .pin-name,
body.names-on .boss-storm .map-plate { opacity: 1; }
/* OFF: only while hovering / pressing, first-visit hint, or when the place needs you */
body.names-off .boss-storm .map-plate { opacity: 0; }
body.names-off .boss-storm:hover .map-plate,
body.names-off .boss-storm:focus-visible .map-plate { opacity: 1; }
body.names-off .pin .pin-name { opacity: 0; }
body.names-off .pin:hover .pin-name,
body.names-off .pin:focus-visible .pin-name,
body.names-off .pin:active .pin-name,
body.names-off .pin.hint .pin-name,
body.names-off .pin.needs-you .pin-name { opacity: 1; }

.boss-storm .map-plate { position: absolute; left: 50%; top: auto; bottom: -6px; transform: translateX(-50%); z-index: 7; }
.pin:hover, .pin:focus-visible { z-index: 9; }

@media (max-width: 520px) {
  .pin .pin-name, .boss-storm .map-plate { font-size: 0.7rem; padding: 1px 6px 2px; border-width: 1.5px; }
  .pin.locked .pin-name.pin-locked-label { font-size: 0.68rem; }
}

/* the old road signpost (town_live.js .adv-sign) would print "Adventures" twice next to the Adventures plate */
body.names-on .adv-sign, body.names-off .adv-sign { display: none; }

/* ---- Settings gear (town top bar) ---- */
.settings-wrap { position: relative; flex-shrink: 0; }
.settings-btn {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: 12px; border: 2px solid var(--brass, #b8893a);
  background: linear-gradient(180deg, #f3e2c0, #d9bf8e); color: #4a2e14;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.settings-btn svg { width: 24px; height: 24px; fill: currentColor; }
.settings-btn[aria-expanded="true"] { background: linear-gradient(180deg, #e8cf98, #cfae6c); }
.settings-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(300px, 86vw);
  padding: 14px 14px 12px; border-radius: 12px; border: 3px solid #6e4520;
  background: linear-gradient(180deg, #f8ebcb, #e9d29c);
  box-shadow: 0 0 0 2px #3d2410, 0 10px 24px rgba(0, 0, 0, 0.5);
  color: #3a2410; font-family: var(--serif, Georgia, serif);
}
.settings-panel[hidden] { display: none; }
.set-title { margin: 0 0 10px; font-size: 1.15rem; text-align: center; letter-spacing: 0.03em; }
.set-row {
  width: 100%; min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer;
  border-radius: 10px; border: 2px solid #8a5a2c; background: rgba(255, 250, 235, 0.65);
  font: 700 1rem/1.2 var(--serif, Georgia, serif); color: #3a2410; text-align: left;
}
.set-word { flex: 1; }
.set-switch { position: relative; width: 52px; height: 28px; border-radius: 14px; background: #8b7a62; border: 2px solid #4a3018; flex-shrink: 0; transition: background 0.15s; }
.set-switch i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6e4c0, #c9a46a); box-shadow: 0 1px 2px rgba(0,0,0,.5); transition: left 0.15s; }
.set-row[aria-checked="true"] .set-switch { background: radial-gradient(circle at 40% 35%, #c8473b, #8a1f17); }
.set-row[aria-checked="true"] .set-switch i { left: 26px; }
.set-state { min-width: 30px; font-weight: 800; }
.set-done {
  display: block; width: 100%; margin-top: 10px; min-height: 46px; cursor: pointer; border-radius: 10px;
  border: 2px solid #3b220e; background: linear-gradient(180deg, #8a5a2c, #5f3b1a); color: #fbecc8;
  font: 800 1rem var(--serif, Georgia, serif); box-shadow: 0 2px 0 #2a1708;
}
/* phone: the gear sits at the left of the wrapped top bar, so center the panel on screen */
@media (max-width: 700px) {
  .settings-panel { position: fixed; left: 50%; right: auto; top: 200px; transform: translateX(-50%); width: min(320px, 90vw); }
}

/* chatmod_v1: Blocked players row (opens chat settings) */
#setBlocked { margin-top: 8px; }
#setBlocked[hidden] { display: none; }
.set-count { min-width: 28px; padding: 2px 8px; border-radius: 10px; background: rgba(110, 69, 32, .18); text-align: center; font-weight: 800; }
.set-go { font-size: 1.3rem; line-height: 1; color: #8a1f17; }
