/* Blue Wave Baseball - open-world hub (Willemstad): the menu tile, the hub
   layer and its HUD, the talk card of a local, and the panel mode that
   shows the game's own screens over the square. Colours follow the menus
   (styles.css) and the account chips (account.css). */

/* ---- the menu tile ------------------------------------------------ */

.mode-tiles.has-hub {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-tiles.has-hub.has-duel {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.hub-tile .mode-icon {
  color: #7fd8e6;
}

.hub-duel-tile .mode-icon {
  color: #f3c744;
}

@media (max-width: 900px) {
  .mode-tiles.has-hub.has-duel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.hub-tile .mode-copy em {
  margin-left: 0.3rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(243, 199, 68, 0.2);
  color: #f3c744;
  font-style: normal;
  letter-spacing: 0.08em;
}

@media (max-width: 560px) {
  .mode-tiles.has-hub .hub-tile { grid-column: 1 / -1; }
  .mode-tiles.has-hub.has-duel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- the hub layer ------------------------------------------------ */

body.in-hub {
  overflow: hidden;
}

.hub-layer {
  position: fixed;
  inset: 0;
  z-index: 55;
  overflow: hidden;
  background: #9fd3f5;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #fffaf0;
}

.hub-stage,
.hub-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hub-canvas {
  display: block;
  touch-action: none;
  outline: none;
}

.hub-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hub-hud button {
  pointer-events: auto;
}

.hub-top {
  position: absolute;
  top: max(0.9rem, env(safe-area-inset-top));
  left: max(0.9rem, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hub-menu,
.hub-mapbtn,
.hub-bag {
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 999px;
  background: rgba(5, 42, 66, 0.72);
  backdrop-filter: blur(9px);
  color: #fffaf0;
  font: 600 0.82rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.hub-menu:hover,
.hub-menu:focus-visible,
.hub-mapbtn:hover,
.hub-mapbtn:focus-visible,
.hub-bag:hover,
.hub-bag:focus-visible {
  background: rgba(6, 74, 115, 0.9);
  border-color: #f3c744;
  transform: translateY(-1px);
}

.hub-menu:focus-visible,
.hub-mapbtn:focus-visible,
.hub-bag:focus-visible,
.hub-worldmap-close:focus-visible,
.hub-worldmap-place:focus-visible,
.hub-prompt-go:focus-visible,
.hub-talk-bye:focus-visible,
.hub-sheet-close:focus-visible {
  outline: 2px solid #f3c744;
  outline-offset: 2px;
}

/* the bag: your outfits and bats (bag.js, a dialog over the square or a panel) */
.hub-bag,
.hub-mapbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-color: rgba(243, 199, 68, 0.6);
}

.hub-bag svg,
.hub-mapbtn svg {
  width: 1rem;
  height: 1rem;
  fill: #f3c744;
}

.hub-place {
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(243, 199, 68, 0.82);
  border-radius: 999px;
  background: rgba(2, 42, 78, 0.86);
  color: #f3c744;
  font: 800 0.72rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* the lobby pill: your lobby and how many are in it; click for the others */
.hub-lobby {
  position: relative;
}

.hub-lobby-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 999px;
  background: rgba(5, 42, 66, 0.72);
  backdrop-filter: blur(9px);
  color: #fffaf0;
  font: 600 0.78rem/1 Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.hub-lobby-pill:hover,
.hub-lobby-pill:focus-visible,
.hub-lobby-pill[aria-expanded="true"] {
  background: rgba(6, 74, 115, 0.9);
  border-color: #f3c744;
}

.hub-lobby-pill:focus-visible {
  outline: 2px solid #f3c744;
  outline-offset: 2px;
}

.hub-lobby-dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #8aa4b4;
  box-shadow: 0 0 0 2px rgba(138, 164, 180, 0.25);
}

.hub-lobby[data-state="on"] .hub-lobby-dot {
  background: #5fd38a;
  box-shadow: 0 0 0 2px rgba(95, 211, 138, 0.28);
}

.hub-lobby[data-state="connecting"] .hub-lobby-dot,
.hub-lobby[data-state="retry"] .hub-lobby-dot {
  background: #f3c744;
  animation: hub-lobby-pulse 1.1s ease-in-out infinite;
}

.hub-lobby[data-state="retry"] .hub-lobby-dot {
  background: #f29b38;
}

.hub-lobby-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 14rem;
  padding: 0.55rem;
  border: 1px solid rgba(243, 199, 68, 0.5);
  border-radius: 0.9rem;
  background: rgba(3, 32, 54, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  animation: hub-pop 0.16s ease-out;
}

.hub-lobby-head {
  margin: 0.15rem 0.35rem 0.5rem;
  color: #f3c744;
  font: 800 0.66rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hub-lobby-list {
  display: grid;
  gap: 0.3rem;
}

.hub-lobby-row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 0.8rem;
  row-gap: 0.15rem;
  align-items: baseline;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 0.65rem;
  background: rgba(255, 250, 240, 0.05);
  color: #fffaf0;
  font: 600 0.8rem/1.2 Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.hub-lobby-row span {
  color: rgba(255, 250, 240, 0.85);
  font-variant-numeric: tabular-nums;
}

.hub-lobby-row small {
  grid-column: 1 / -1;
  color: rgba(255, 250, 240, 0.62);
  font-size: 0.7rem;
  font-weight: 500;
}

.hub-lobby-row:hover:not(:disabled),
.hub-lobby-row:focus-visible {
  border-color: #f3c744;
  background: rgba(243, 199, 68, 0.12);
}

.hub-lobby-row.here {
  border-color: rgba(95, 211, 138, 0.55);
}

.hub-lobby-row.here small {
  color: #5fd38a;
}

.hub-lobby-row:disabled {
  cursor: default;
}

.hub-lobby-row:disabled:not(.here) {
  opacity: 0.55;
}

.hub-lobby-note {
  margin: 0.3rem 0.35rem;
  color: rgba(255, 250, 240, 0.72);
  font-size: 0.78rem;
}

@keyframes hub-lobby-pulse {
  50% { opacity: 0.35; }
}

@keyframes hub-bubble-still {
  0%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

.hub-help {
  position: absolute;
  left: max(0.9rem, env(safe-area-inset-left));
  bottom: calc(max(0.9rem, env(safe-area-inset-bottom)) + 3.1rem);
  margin: 0;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(5, 42, 66, 0.72);
  color: rgba(255, 250, 240, 0.92);
  font: 600 0.8rem/1.2 Inter, system-ui, sans-serif;
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hub-help.show {
  opacity: 1;
  transform: none;
}

.hub-layer kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.3rem;
  border: 1px solid rgba(255, 250, 240, 0.5);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  font: 800 0.72rem/1 Inter, system-ui, sans-serif;
}

/* the door (or closed exit) in reach */
.hub-prompt {
  position: absolute;
  right: max(0.9rem, env(safe-area-inset-right));
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 0.55rem 0.95rem 0.55rem 0.55rem;
  border: 1px solid rgba(243, 199, 68, 0.82);
  border-radius: 0.6rem;
  background: rgba(2, 42, 78, 0.92);
  box-shadow: 0 14px 40px rgba(0, 20, 38, 0.36);
  animation: hub-pop 0.18s ease;
}

.hub-prompt.later {
  border-color: rgba(255, 250, 240, 0.3);
}

.hub-prompt-go {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem 0.5rem 0.5rem;
  border: 0;
  border-radius: 0.45rem;
  background: #f3c744;
  color: #052a42;
  font: 800 0.86rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.hub-prompt-go kbd {
  border-color: rgba(5, 42, 66, 0.55);
  color: #052a42;
}

.hub-prompt.later .hub-prompt-go {
  background: rgba(255, 250, 240, 0.16);
  color: #fffaf0;
}

.hub-prompt.later .hub-prompt-go kbd {
  border-color: rgba(255, 250, 240, 0.5);
  color: #fffaf0;
}

.hub-prompt-copy strong,
.hub-prompt-copy small {
  display: block;
}

.hub-prompt-copy strong {
  font: 800 0.98rem/1.2 "Playfair Display", Georgia, serif;
}

.hub-prompt-copy small {
  margin-top: 0.15rem;
  color: rgba(255, 250, 240, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* emotes: a button bottom left, the four in a tray above it */
.hub-emotes {
  position: absolute;
  left: max(0.9rem, env(safe-area-inset-left));
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.hub-emote-open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem 0.5rem 0.75rem;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 999px;
  background: rgba(5, 42, 66, 0.72);
  backdrop-filter: blur(9px);
  color: #fffaf0;
  font: 600 0.82rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.hub-emote-open svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: #f3c744;
}

.hub-emote-open:hover,
.hub-emote-open[aria-expanded="true"] {
  border-color: #f3c744;
  background: rgba(6, 74, 115, 0.9);
}

/* ---- chat (hub/chat.js) ------------------------------------------- */

.hub-chat-open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem 0.5rem 0.75rem;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 999px;
  background: rgba(5, 42, 66, 0.72);
  backdrop-filter: blur(9px);
  color: #fffaf0;
  font: 600 0.82rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.hub-chat-open svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: #7fd8e6;
}

.hub-chat-open:hover,
.hub-chat-open:focus-visible,
.hub-hud.chat-open .hub-chat-open {
  border-color: #f3c744;
  background: rgba(6, 74, 115, 0.9);
}

.hub-chat-open.closed {
  color: rgba(255, 250, 240, 0.62);
}

.hub-chat-open.closed svg {
  fill: rgba(255, 250, 240, 0.45);
}

.hub-chat {
  position: absolute;
  left: 50%;
  bottom: calc(max(0.9rem, env(safe-area-inset-bottom)) + 4.1rem + var(--hub-kb, 0px));
  width: min(34rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.4rem;
  transform: translateX(-50%);
  pointer-events: auto;
}

.hub-chat-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid rgba(243, 199, 68, 0.7);
  border-radius: 999px;
  background: rgba(2, 36, 64, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 20, 38, 0.35);
}

.hub-chat-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.4rem;
  border: 0;
  background: transparent;
  color: #fffaf0;
  font: 500 0.92rem/1.2 Inter, system-ui, sans-serif;
  outline: none;
}

.hub-chat-input::placeholder {
  color: rgba(255, 250, 240, 0.55);
}

.hub-chat-input:disabled::placeholder {
  color: #f3c744;
}

.hub-chat-logbtn,
.hub-chat-send {
  flex: none;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(255, 250, 240, 0.25);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.08);
  color: #fffaf0;
  font: 700 0.76rem/1 Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.hub-chat-send {
  min-width: 4.2rem;
  border-color: #f3c744;
  background: #f3c744;
  color: #062a47;
}

.hub-chat-send:disabled {
  border-color: rgba(243, 199, 68, 0.45);
  background: rgba(243, 199, 68, 0.3);
  color: rgba(255, 250, 240, 0.8);
  cursor: default;
}

.hub-chat-logbtn[aria-expanded="true"],
.hub-chat-logbtn:hover {
  border-color: #f3c744;
}

.hub-chat-logbtn:focus-visible,
.hub-chat-send:focus-visible,
.hub-chat-open:focus-visible,
.hub-tag-menu button:focus-visible {
  outline: 2px solid #f3c744;
  outline-offset: 2px;
}

.hub-chat-note {
  justify-self: center;
  margin: 0;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(120, 22, 22, 0.88);
  color: #fffaf0;
  font: 600 0.78rem/1.25 Inter, system-ui, sans-serif;
  text-align: center;
}

.hub-chat-log {
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 250, 240, 0.18);
  border-radius: 0.8rem;
  background: rgba(2, 30, 54, 0.86);
  backdrop-filter: blur(10px);
}

.hub-chat-rules {
  margin: 0 0 0.4rem;
  color: rgba(255, 250, 240, 0.6);
  font: 500 0.7rem/1.3 Inter, system-ui, sans-serif;
}

.hub-chat-log ol {
  max-height: min(13rem, 34vh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  font: 500 0.84rem/1.35 Inter, system-ui, sans-serif;
}

.hub-chat-log li {
  padding: 0.12rem 0;
  overflow-wrap: anywhere;
}

.hub-chat-log li b {
  margin-right: 0.4rem;
  color: #7fd8e6;
  font-weight: 700;
}

.hub-chat-log li.mine b {
  color: #f3c744;
}

.hub-chat-log ol:empty::before {
  content: "Nothing said yet.";
  color: rgba(255, 250, 240, 0.5);
}

/* the chat bar is up: a local's line sits above it */
.hub-hud.chat-open .hub-talk {
  bottom: calc(max(0.9rem, env(safe-area-inset-bottom)) + 8rem);
}

.hub-hud.chat-open .hub-help {
  opacity: 0;
}

/* a name tag's menu: block, report, and the admin tools */
.hub-tag-menu {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 0.25rem;
  width: 13.5rem;
  padding: 0.55rem;
  border: 1px solid rgba(243, 199, 68, 0.6);
  border-radius: 0.8rem;
  background: rgba(3, 32, 54, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.hub-tag-menu-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.1rem 0.25rem 0.25rem;
}

.hub-tag-menu-head strong {
  overflow: hidden;
  color: #fffaf0;
  font: 800 0.9rem/1.2 Inter, system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-tag-menu-head small {
  flex: none;
  color: #f3c744;
  font: 700 0.7rem/1 Inter, system-ui, sans-serif;
}

.hub-tag-menu-line {
  margin: 0 0.25rem 0.2rem;
  color: rgba(255, 250, 240, 0.72);
  font: italic 500 0.76rem/1.3 Inter, system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.hub-tag-menu-sep {
  margin: 0.35rem 0.25rem 0.05rem;
  color: #f3c744;
  font: 800 0.62rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hub-tag-menu button {
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 0.55rem;
  background: rgba(255, 250, 240, 0.05);
  color: #fffaf0;
  font: 600 0.8rem/1.1 Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.hub-tag-menu button:hover:not(:disabled) {
  border-color: #f3c744;
  background: rgba(243, 199, 68, 0.12);
}

.hub-tag-menu button.warn:hover:not(:disabled) {
  border-color: #ff8a6a;
  background: rgba(255, 138, 106, 0.14);
}

.hub-tag-menu button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Willemstad has its own chat: the menus' "Public chat" drawer waits */
body.in-hub #acc-board-open {
  display: none;
}

.hub-emote-tray {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  display: grid;
  gap: 0.3rem;
  min-width: 11rem;
  padding: 0.4rem;
  border: 1px solid rgba(243, 199, 68, 0.6);
  border-radius: 0.6rem;
  background: rgba(2, 42, 78, 0.94);
  box-shadow: 0 14px 36px rgba(0, 20, 38, 0.36);
}

.hub-emote-tray button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.6rem 0.4rem 0.4rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: #fffaf0;
  font: 600 0.84rem/1 Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.hub-emote-tray button:hover,
.hub-emote-tray button:focus-visible {
  background: rgba(255, 250, 240, 0.12);
  outline: none;
}

/* other players' name tags (hub/crowd.js places them each frame) */
.hub-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hub-tag {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.hub-tag-name {
  position: absolute;
  left: 0;
  bottom: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.14rem 0.45rem;
  border: 0;
  border-radius: 999px;
  background: rgba(3, 32, 58, 0.72);
  color: #fffaf0;
  font: 700 0.68rem/1.2 Inter, system-ui, sans-serif;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: pointer;
}

.hub-tag-name i {
  color: #f3c744;
  font-style: normal;
  font-weight: 800;
  font-size: 0.62rem;
}

.hub-tag-bubbles {
  position: absolute;
  left: 0;
  bottom: 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transform: translateX(-50%);
}

.hub-tag-you .hub-tag-bubbles {
  bottom: 0.3rem;
}

/* a chat bubble: pops up, the next one pushes it up, fades after ~6 s */
.hub-bubble {
  position: relative;
  display: block;
  width: max-content;
  max-width: 15rem;
  padding: 0.3rem 0.62rem;
  border-radius: 0.75rem;
  background: #fffaf0;
  color: #06243e;
  box-shadow: 0 4px 14px rgba(0, 24, 44, 0.28);
  font: 600 0.8rem/1.3 Inter, system-ui, sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
  animation: hub-bubble 6.5s ease forwards;
}

.hub-bubble:last-child::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.3rem;
  width: 0.6rem;
  height: 0.6rem;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 0.12rem 0;
}

.hub-bubble.mine {
  background: #fff1c2;
}

@keyframes hub-bubble {
  0% { opacity: 0; transform: translateY(0.4rem) scale(0.92); }
  5% { opacity: 1; transform: none; }
  88% { opacity: 1; }
  100% { opacity: 0; }
}

/* a local's line */
.hub-talk {
  position: absolute;
  left: 50%;
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  width: min(31rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem 0.75rem;
  border: 1px solid rgba(243, 199, 68, 0.82);
  border-radius: 0.6rem;
  background: rgba(2, 42, 78, 0.94);
  box-shadow: 0 16px 44px rgba(0, 20, 38, 0.4);
  transform: translateX(-50%);
  pointer-events: auto;
}

.hub-talk.pop {
  animation: hub-talk-pop 0.2s ease;
}

.hub-talk-who {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.hub-talk-name {
  color: #f3c744;
  font: 800 1.02rem/1.2 "Playfair Display", Georgia, serif;
}

.hub-talk-role,
.hub-talk-count {
  color: rgba(255, 250, 240, 0.66);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hub-talk-greet {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
}

.hub-talk-word {
  font-weight: 800;
}

.hub-talk-gloss {
  color: rgba(255, 250, 240, 0.62);
  font-style: italic;
}

.hub-talk-line {
  margin: 0.2rem 0 0;
  max-width: 62ch;
  font-size: 0.95rem;
  line-height: 1.45;
}

.hub-talk-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.hub-talk-bye {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem 0.38rem 0.4rem;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 0.45rem;
  background: rgba(255, 250, 240, 0.1);
  color: #fffaf0;
  font: 700 0.8rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.hub-talk-bye:hover {
  border-color: #f3c744;
}

.hub-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  background: #052a42;
  color: #fffaf0;
  font: 700 0.9rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.06em;
}

.hub-spinner {
  width: 2.2rem;
  height: 2.2rem;
  border: 3px solid rgba(243, 199, 68, 0.25);
  border-top-color: #f3c744;
  border-radius: 50%;
  animation: hub-spin 0.8s linear infinite;
}

.hub-fade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #052a42;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.hub-fade.on {
  opacity: 1;
}

/* The name of the room you just came to: pops in, stays, fades out. */
.hub-roomtitle {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}
.hub-roomtitle strong {
  color: #f3c744;
  font: 900 clamp(2.2rem, 8vw, 5.2rem)/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0.06em 0 #052a42, 0 0 0.35em rgba(5, 42, 66, 0.85), 0 0.12em 0.5em rgba(0, 0, 0, 0.45);
}
.hub-roomtitle small {
  color: #ffffff;
  font: 700 clamp(0.8rem, 2.2vw, 1.2rem)/1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0.3em rgba(5, 42, 66, 0.9);
}
.hub-roomtitle small:empty { display: none; }
.hub-roomtitle.on {
  animation: hub-roomtitle 2.3s ease-out both;
}
@keyframes hub-roomtitle {
  0% { opacity: 0; transform: scale(0.9) translateY(0.4rem); }
  12% { opacity: 1; transform: scale(1.03) translateY(0); }
  20% { transform: scale(1) translateY(0); }
  68% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(1.02) translateY(-0.3rem); }
}
@media (prefers-reduced-motion: reduce) {
  .hub-roomtitle.on { animation-name: hub-roomtitle-fade; }
  @keyframes hub-roomtitle-fade { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
}

/* ---- panels: the game's own screens over the square ----------------- *
 * hub-mode.js sets body.hub-panel and shows the menu (#team-menu) as a
 * sheet above the hub layer (55) and below the account chips (60) and every
 * dialog (70-95). Only the view for the door shows: the menu title, mode
 * tiles, visuals switch and "Back to game" are hidden. The square stays
 * behind it, dimmed and paused.                                           */

.hub-sheet-head {
  display: none;
}

body.hub-panel #team-menu {
  position: fixed;
  inset: 0;
  z-index: 57;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  padding: calc(max(0.9rem, env(safe-area-inset-top)) + 2.9rem) max(0.9rem, env(safe-area-inset-right)) max(0.9rem, env(safe-area-inset-bottom)) max(0.9rem, env(safe-area-inset-left));
  overflow: hidden;
  background: rgba(2, 22, 40, 0.46);
  animation: hub-dim 0.2s ease;
}

body.hub-panel #team-menu::before,
body.hub-panel .menu-brand,
body.hub-panel .setup-heading,
body.hub-panel .mode-tiles,
body.hub-panel #menu-back-button,
body.hub-panel #career-style-panel {
  display: none !important;
}

/* The sheet is as tall as its screen needs, up to the whole height (then
   the view scrolls inside it); never a sliver while a view loads. */
body.hub-panel .setup-panel {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  width: min(1120px, 100%);
  min-height: min(26rem, 100%);
  max-height: 100%;
  margin: 0 auto;
  border-bottom: 1px solid rgba(243, 199, 68, 0.82);
  border-radius: 0.5rem;
  animation: hub-sheet-in 0.22s ease;
}

/* Whichever view is showing scrolls; the header and the confirm bar stay. */
body.hub-panel #batting-practice-settings,
body.hub-panel #career-panel,
body.hub-panel #leaderboard-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.hub-panel .hub-sheet-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(105, 193, 238, 0.36);
}

.hub-sheet-close {
  flex: none;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(243, 199, 68, 0.82);
  border-radius: 999px;
  background: rgba(1, 29, 58, 0.7);
  color: #fffaf0;
  font: 700 0.8rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.18s ease;
}

.hub-sheet-close:hover {
  background: rgba(6, 74, 115, 0.9);
}

.hub-sheet-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.65rem;
  min-width: 0;
}

.hub-sheet-title strong {
  color: #f3c744;
  font: 800 1.15rem/1.15 "Playfair Display", Georgia, serif;
}

.hub-sheet-title small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hub-sheet-esc {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.hub-sheet-esc kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.3rem;
  margin-right: 0.25rem;
  padding: 0 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  font: 800 0.64rem/1 Inter, system-ui, sans-serif;
}

@media (hover: none), (pointer: coarse) {
  .hub-sheet-esc { display: none; }
}

/* ---- world panels (M4a): one header, three sizes, the place's tabs ---- */

/* Sizes: small (a local, the Next Game popup), medium (a shop), large (the
   market, the lineup). Height follows the content, up to the screen. */
body.hub-panel[data-hub-size="small"] .setup-panel { width: min(38rem, 100%); min-height: 0; }
body.hub-panel[data-hub-size="medium"] .setup-panel { width: min(52rem, 100%); min-height: min(24rem, 100%); }
body.hub-panel[data-hub-size="large"] .setup-panel { width: min(1120px, 100%); }
body.hub-panel .setup-panel { transition: width 0.18s ease; }

.hub-sheet-cash {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  padding: 0.32rem 0.7rem 0.32rem 0.36rem;
  border: 1px solid rgba(243, 199, 68, 0.55);
  border-radius: 999px;
  background: rgba(1, 29, 58, 0.7);
  color: #fffaf0;
  font: 800 0.82rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.hub-sheet-cash i {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #f3c744;
  color: #082b45;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
}

body.hub-panel .hub-sheet-cash { display: inline-flex; }
body.hub-panel .hub-sheet-esc { margin-left: 0; }
/* A small panel keeps its header to the place, the cash and the bag. */
body.hub-panel[data-hub-size="small"] .hub-sheet-esc { display: none; }
body.hub-panel[data-hub-size="small"] .hub-sheet-title strong { font-size: 1.02rem; }
/* The header shows your cash already. */
body.hub-panel .career-heading .cash-chip { display: none; }

.hub-sheet-bag {
  display: none;
  flex: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border: 1px solid rgba(243, 199, 68, 0.6);
  border-radius: 999px;
  background: rgba(1, 29, 58, 0.7);
  color: #fffaf0;
  font: 700 0.78rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.hub-sheet-bag svg { width: 0.95rem; height: 0.95rem; fill: #f3c744; }
.hub-sheet-bag:hover, .hub-sheet-bag:focus-visible { background: rgba(6, 74, 115, 0.9); border-color: #f3c744; }
.hub-sheet-bag:focus-visible { outline: 2px solid #f3c744; outline-offset: 2px; }
body.hub-panel .hub-sheet-bag { display: inline-flex; }

.hub-sheet-tabs { display: none; }

body.hub-panel .hub-sheet-tabs:not([hidden]) {
  display: flex;
  flex: none;
  gap: 0.35rem;
  padding: 0.55rem 1rem 0;
}

.hub-sheet-tabs button {
  padding: 0.42rem 0.95rem;
  border: 1px solid rgba(105, 193, 238, 0.4);
  border-radius: 999px;
  background: rgba(1, 29, 58, 0.55);
  color: rgba(255, 255, 255, 0.78);
  font: 700 0.8rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.hub-sheet-tabs button:hover { color: #fffaf0; border-color: rgba(243, 199, 68, 0.7); }
.hub-sheet-tabs button.active { background: #f3c744; border-color: #f3c744; color: #082b45; }
.hub-sheet-tabs button:focus-visible { outline: 2px solid #f3c744; outline-offset: 2px; }

/* One place, one job: the screens' own footers ("← Back to career",
   "← Back to club") and the leaderboard's back link have no place in a
   world panel. The leaderboard keeps its reset countdown. */
body.hub-panel .career-footer,
body.hub-panel .lb-footer [data-action="back"] {
  display: none !important;
}

/* A link into another building, turned into a direction. */
.world-direction {
  margin: 0.4rem 0 0;
  color: #9ed8f7;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
}

.world-direction::before {
  content: "➜ ";
  color: #f3c744;
}

@media (max-width: 700px) {
  .hub-sheet-bag span { display: none; }
  body.hub-panel .hub-sheet-head { flex-wrap: wrap; }
}

/* Portrait tablets: the account chips are a strip across the top there
   (mobile.css), so the HUD and the panel start below it. */
@media (max-width: 920px) and (orientation: portrait) {
  .hub-top {
    top: calc(var(--mob-topbar, 0px) + 0.6rem);
  }

  body.hub-panel #team-menu {
    padding-top: calc(var(--mob-topbar, 0px) + 0.5rem);
    padding-inline: 0.6rem;
  }
}

@keyframes hub-pop {
  from { opacity: 0; transform: translateY(0.35rem); }
  to { opacity: 1; transform: none; }
}

@keyframes hub-spin {
  to { transform: rotate(360deg); }
}

@keyframes hub-talk-pop {
  from { opacity: 0; transform: translate(-50%, 0.4rem); }
  to { opacity: 1; transform: translateX(-50%); }
}

@keyframes hub-dim {
  from { background: rgba(2, 22, 40, 0); }
  to { background: rgba(2, 22, 40, 0.46); }
}

@keyframes hub-sheet-in {
  from { opacity: 0; transform: translateY(0.6rem); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-prompt, .hub-spinner, .hub-talk.pop, body.hub-panel #team-menu, body.hub-panel .setup-panel, .hub-lobby-dot, .hub-lobby-menu { animation: none; }
  .hub-bubble { animation-name: hub-bubble-still; }
  .hub-fade, .hub-help, .hub-menu, .hub-bag, .hub-mapbtn, .hub-sheet-close { transition: none; }
  body.hub-panel .setup-panel { transition: none; }
}

/* a friend: a subtle green trim on the name tag (M4c) */
.hub-tag-friend .hub-tag-name {
  box-shadow: inset 0 0 0 1.5px #35c97f;
}

.hub-tag-menu button.friend {
  color: #7fe3ab;
}

/* the minimap (M4c): top right, under the account chips */
.hub-minimap {
  position: absolute;
  top: calc(max(0.9rem, env(safe-area-inset-top)) + 2.7rem);
  right: max(0.9rem, env(safe-area-inset-right));
  border: 1px solid rgba(255, 250, 240, 0.3);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 24, 44, 0.3);
  pointer-events: none;
}

.hub-minimap canvas { display: block; }

.hub-minimap-toggle {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(3, 32, 58, 0.72);
  cursor: pointer;
  pointer-events: auto;
}

.hub-minimap-toggle::before {
  content: "";
  position: absolute;
  inset: 0.32rem;
  border-radius: 2px;
  background: #fffaf0;
  opacity: 0.85;
}

.hub-minimap.collapsed { border: 0; box-shadow: none; }
.hub-minimap.collapsed canvas { display: none; }
.hub-minimap.collapsed .hub-minimap-toggle { position: static; display: block; width: 1.9rem; height: 1.9rem; }
.hub-minimap.collapsed .hub-minimap-toggle::before { inset: 0.55rem; }

/* ---- phones (M4d): the same world, scaled down ------------------------ */
/* body.hub-phone comes from hub/hub-mode.js (the shorter screen side is
   under 700 px); the media query also catches a narrow desktop window. */

@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  .hub-top { gap: 0.35rem; }
  .hub-menu, .hub-bag, .hub-mapbtn { padding: 0.45rem 0.7rem; font-size: 0.78rem; }
  .hub-bag span, .hub-mapbtn span { display: none; }
  .hub-bag, .hub-mapbtn { padding: 0.5rem; }
  .hub-place { display: none; }
  .hub-lobby-pill { padding: 0.42rem 0.65rem; font-size: 0.72rem; }
  .hub-help { display: none; }

  /* Thumb-sized round buttons at the bottom left: emotes and chat. */
  .hub-emotes { gap: 0.4rem; }
  .hub-emote-open, .hub-chat-open { width: 2.9rem; height: 2.9rem; padding: 0; justify-content: center; }
  .hub-emote-open span, .hub-chat-open span { display: none; }
  .hub-emote-open svg, .hub-chat-open svg { width: 1.3rem; height: 1.3rem; }

  /* The door prompt sits above the buttons, the full width of the screen. */
  .hub-prompt {
    left: max(0.6rem, env(safe-area-inset-left));
    right: max(0.6rem, env(safe-area-inset-right));
    bottom: calc(max(0.9rem, env(safe-area-inset-bottom)) + 3.6rem);
    max-width: none;
  }
  .hub-prompt-go { padding: 0.65rem 0.9rem; }
  .hub-prompt-go kbd { display: none; }

  .hub-chat { width: calc(100vw - 1.2rem); bottom: calc(max(0.9rem, env(safe-area-inset-bottom)) + 3.8rem + var(--hub-kb, 0px)); }
  /* 16 px keeps iOS from zooming into the field. */
  .hub-chat-input { font-size: 16px; }
  .hub-chat-logbtn, .hub-chat-send { min-height: 2.4rem; }

  .hub-talk { width: calc(100vw - 1.2rem); }
  .hub-tag-menu button { min-height: 2.6rem; }

  /* The minimap: smaller, under the account strip. */
  .hub-minimap { top: calc(var(--mob-topbar, 0px) + 3.6rem); right: max(0.6rem, env(safe-area-inset-right)); }
  .hub-minimap canvas { width: 118px !important; height: auto !important; }
}

/* Panels are full-screen sheets on a phone (the shop, the lineup, the gate). */
@media (max-width: 700px) {
  body.hub-panel #team-menu { padding: calc(var(--mob-topbar, 0px) + 0.3rem) 0 0; }
  body.hub-panel[data-hub-size] .setup-panel {
    width: 100%;
    min-height: 100%;
    height: 100%;
    border-radius: 0;
    border-inline: 0;
  }
  body.hub-panel .hub-sheet-head { padding: 0.55rem 0.75rem; gap: 0.5rem; }
  body.hub-panel .hub-sheet-title strong { font-size: 1rem; }
  body.hub-panel .hub-sheet-title small { display: none; }
  body.hub-panel .hub-sheet-close { padding: 0.5rem 0.8rem; }
  body.hub-panel .hub-sheet-tabs:not([hidden]) { padding: 0.5rem 0.75rem 0; overflow-x: auto; }
}


/* ---- the Map (M5): every place of Willemstad, open ones take you there ---- */

.hub-worldmap {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgba(2, 22, 40, 0.55);
  pointer-events: auto;
  animation: hub-dim 0.2s ease;
}

.hub-worldmap[hidden] { display: none; }

.hub-worldmap-card {
  width: min(880px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(243, 199, 68, 0.82);
  border-radius: 0.6rem;
  background: rgba(3, 34, 58, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: hub-sheet-in 0.22s ease;
}

.hub-worldmap-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(243, 199, 68, 0.3);
}

.hub-worldmap-card header strong {
  display: block;
  color: #f3c744;
  font: 800 1rem/1.1 "Playfair Display", Georgia, serif;
  letter-spacing: 0.04em;
}

.hub-worldmap-card header small {
  color: rgba(255, 250, 240, 0.72);
  font: 500 0.78rem/1.3 Inter, system-ui, sans-serif;
}

.hub-worldmap-close {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 999px;
  background: rgba(5, 42, 66, 0.72);
  color: #fffaf0;
  font: 600 1rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.hub-worldmap-close kbd { font: 600 0.68rem/1 Inter, system-ui, sans-serif; opacity: 0.7; }
.hub-worldmap-close:hover { border-color: #f3c744; }

/* The sketch: Punda on top, the bay in the middle, Otrobanda below. */
.hub-worldmap-sketch {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 19rem;
  margin: 0.8rem;
  border-radius: 0.45rem;
  overflow: hidden;
  background:
    linear-gradient(to bottom, #d9c7a0 0 31%, #1f7fb0 31% 49%, #d9c7a0 49% 100%);
}

.hub-worldmap-bay {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.55);
  font: 700 0.7rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  pointer-events: none;
}

.hub-worldmap-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hub-worldmap-lines line {
  stroke: rgba(5, 42, 66, 0.35);
  stroke-width: 3;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
}

.hub-worldmap-lines line.on { stroke: #f3c744; stroke-dasharray: none; stroke-width: 4; }

.hub-worldmap-places { position: absolute; inset: 0; }

.hub-worldmap-place {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 10.5rem;
  max-width: 28%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid rgba(5, 42, 66, 0.55);
  border-radius: 0.5rem;
  background: rgba(244, 236, 214, 0.92);
  color: #052a42;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-worldmap-place strong { font: 800 0.82rem/1.15 Inter, system-ui, sans-serif; }
.hub-worldmap-place small { font: 500 0.66rem/1.25 Inter, system-ui, sans-serif; opacity: 0.8; }
.hub-worldmap-place em { margin-top: 0.15rem; padding: 0.12rem 0.5rem; border-radius: 999px; background: rgba(5, 42, 66, 0.12); font: 800 0.62rem/1.2 Inter, system-ui, sans-serif; font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; }

.hub-worldmap-place.open { background: #fffaf0; border-color: #1f5ea8; box-shadow: 0 3px 10px rgba(5, 42, 66, 0.3); }
.hub-worldmap-place.open em { background: #1f5ea8; color: #fff; }
.hub-worldmap-place.open:hover { transform: translate(-50%, calc(-50% - 2px)); box-shadow: 0 6px 16px rgba(5, 42, 66, 0.4); }
.hub-worldmap-place.here { border-color: #f3c744; box-shadow: 0 0 0 3px rgba(243, 199, 68, 0.75); }
.hub-worldmap-place.here em { background: #f3c744; color: #052a42; }
.hub-worldmap-place.soon { cursor: default; background: rgba(244, 236, 214, 0.6); border-style: dashed; }
.hub-worldmap-place.soon strong, .hub-worldmap-place.soon small { opacity: 0.6; }

@media (max-width: 700px), (max-height: 520px) and (pointer: coarse) {
  .hub-worldmap { padding: 0; align-items: stretch; }
  .hub-worldmap-card { border-radius: 0; border-inline: 0; }
  .hub-worldmap-card header { padding-top: calc(var(--mob-topbar, 0px) + max(0.6rem, env(safe-area-inset-top))); }
  .hub-worldmap-card header kbd { display: none; }
  .hub-worldmap-sketch { flex: 1; aspect-ratio: auto; min-height: 0; margin: 0.6rem; }
  .hub-worldmap-place { width: 5.4rem; max-width: 30%; padding: 0.4rem 0.3rem; }
  .hub-worldmap-place small { display: none; }
  .hub-worldmap-place strong { font-size: 0.7rem; }
  .hub-worldmap-place em { font-size: 0.55rem; padding: 0.1rem 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-worldmap, .hub-worldmap-card { animation: none; }
}


/* ---- stance, invites and plays (hub/hub-mode.js tray, hub/plays.js) ---- */

.hub-tray-emotes { display: grid; gap: 0.3rem; }

.hub-tray-head {
  margin: 0.35rem 0.4rem 0.05rem;
  font: 700 0.66rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 250, 240, 0.62);
}

.hub-tray-head kbd {
  margin-left: 0.25rem;
  padding: 0.05rem 0.3rem;
  border: 1px solid rgba(255, 250, 240, 0.4);
  border-radius: 0.25rem;
  font: inherit;
  letter-spacing: 0;
}

.hub-tray-row { display: flex; gap: 0.25rem; }

.hub-emote-tray .hub-tray-row button {
  flex: 1;
  justify-content: center;
  padding: 0.45rem 0.4rem;
  border: 1px solid rgba(255, 250, 240, 0.22);
  text-align: center;
}

.hub-emote-tray .hub-tray-row button[aria-pressed="true"] {
  border-color: #f3c744;
  background: rgba(243, 199, 68, 0.2);
  color: #fff6d6;
}

.hub-tag-menu button.play { color: #f3c744; }
.hub-tag-menu button.play:disabled { color: inherit; }

.hub-invite {
  position: absolute;
  left: 50%;
  top: max(4.2rem, calc(env(safe-area-inset-top) + 3.6rem));
  transform: translateX(-50%);
  z-index: 30;
  width: min(22rem, calc(100% - 1.6rem));
  padding: 0.75rem 0.85rem 0.8rem;
  border: 1px solid rgba(243, 199, 68, 0.7);
  border-radius: 0.7rem;
  background: rgba(2, 42, 78, 0.95);
  box-shadow: 0 14px 36px rgba(0, 20, 38, 0.4);
  color: #fffaf0;
  font: 500 0.92rem/1.35 Inter, system-ui, sans-serif;
  pointer-events: auto;
}

.hub-invite[hidden], .hub-play[hidden] { display: none; }
.hub-invite-text { margin: 0 0 0.55rem; }
.hub-invite-text strong { color: #f3c744; }

.hub-invite-bar {
  height: 4px;
  margin-bottom: 0.6rem;
  border-radius: 2px;
  background: rgba(255, 250, 240, 0.16);
  overflow: hidden;
}

.hub-invite-bar i {
  display: block;
  height: 100%;
  background: #f3c744;
  transform-origin: left center;
}

@keyframes hub-invite-run { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.hub-invite-buttons { display: flex; gap: 0.5rem; }

.hub-invite-buttons button,
.hub-play button {
  flex: 1;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(255, 250, 240, 0.34);
  border-radius: 0.5rem;
  background: rgba(255, 250, 240, 0.08);
  color: #fffaf0;
  font: 700 0.9rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.hub-invite-buttons .hub-invite-yes,
.hub-play.hub-play-on .hub-play-throw {
  border-color: #f3c744;
  background: #f3c744;
  color: #082a47;
}

.hub-play {
  position: absolute;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(243, 199, 68, 0.6);
  border-radius: 0.8rem;
  background: rgba(2, 42, 78, 0.92);
  backdrop-filter: blur(9px);
  color: #fffaf0;
  font: 600 0.88rem/1 Inter, system-ui, sans-serif;
  pointer-events: auto;
  white-space: nowrap;
}

.hub-play-count { padding: 0 0.5rem; min-width: 7.5rem; text-align: center; }
.hub-play button { flex: none; min-width: 5.2rem; }
.hub-play button:disabled { opacity: 0.55; cursor: default; }
.hub-play-throw kbd { margin-right: 0.4rem; padding: 0.1rem 0.32rem; border: 1px solid currentColor; border-radius: 0.25rem; font: inherit; opacity: 0.8; }

@media (pointer: coarse) {
  .hub-play { bottom: max(4.2rem, calc(env(safe-area-inset-bottom) + 3.4rem)); }
  .hub-play button { min-height: 3rem; min-width: 6rem; font-size: 1rem; }
  .hub-play-throw kbd { display: none; }
}

.hub-pops { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.hub-pop {
  position: absolute;
  left: 0;
  top: 0;
  margin: -0.8rem 0 0 -2rem;
  width: 4rem;
  text-align: center;
  font: 800 1.15rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: #fffaf0;
  text-shadow: 0 2px 6px rgba(0, 20, 38, 0.8);
}

.hub-pop-good { color: #f3c744; font-size: 1.4rem; }

/* residents (NPCs): to everybody a player like any other; admins see a violet trim and an NPC chip on the name tag */
.hub-tag-chip {
  display: none;
  padding: 0.05rem 0.28rem;
  border-radius: 0.3rem;
  background: #b46cff;
  color: #1c0a33;
  font: 900 0.52rem/1.15 Inter, system-ui, sans-serif;
  font-style: normal;
  letter-spacing: 0.08em;
}
.hub-tag-npc .hub-tag-chip { display: inline-block; align-self: center; }
.hub-tag-npc .hub-tag-name {
  background: rgba(38, 14, 66, 0.82);
  box-shadow: inset 0 0 0 1.5px #b46cff, 0 0 0 1px rgba(180, 108, 255, 0.35);
}
.hub-tag-menu-chip {
  align-self: center;
  padding: 0.08rem 0.35rem;
  border-radius: 0.3rem;
  background: #b46cff;
  color: #1c0a33;
  font: 900 0.58rem/1.15 Inter, system-ui, sans-serif;
  letter-spacing: 0.08em;
}

/* the residents' admin button (top bar, admins only) and panel (hub/npc-admin.js) */
.hub-npc-admin {
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(180, 108, 255, 0.7);
  border-radius: 999px;
  background: rgba(38, 14, 66, 0.78);
  backdrop-filter: blur(9px);
  color: #e6d2ff;
  font: 800 0.74rem/1 Inter, system-ui, sans-serif;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.hub-npc-admin[hidden] { display: none; }
.hub-npc-admin:hover,
.hub-npc-admin:focus-visible,
.hub-npc-admin.on {
  background: rgba(70, 28, 120, 0.92);
  border-color: #c99bff;
  transform: translateY(-1px);
}
.hub-npc-admin:focus-visible { outline: 2px solid #f3c744; outline-offset: 2px; }
.hub-npc-admin .dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: #7d7d8c;
  vertical-align: 0.05rem;
}
.hub-npc-admin.live .dot { background: #5fe3a1; box-shadow: 0 0 6px #5fe3a1; }

.hub-npc-panel {
  position: absolute;
  z-index: 6;
  top: calc(max(0.9rem, env(safe-area-inset-top)) + 3.2rem);
  left: max(0.9rem, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: min(23rem, calc(100vw - 1.8rem));
  max-height: calc(100% - 7.5rem);
  padding: 0.8rem;
  border: 1px solid rgba(180, 108, 255, 0.6);
  border-radius: 0.9rem;
  background: rgba(14, 12, 40, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.42);
  color: #fffaf0;
  font-family: Inter, system-ui, sans-serif;
  pointer-events: auto;
}
.hub-npc-panel[hidden] { display: none; }
.hub-npc-panel header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.hub-npc-panel header strong { font: 800 1rem/1.2 Inter, system-ui, sans-serif; margin-right: 0.5rem; }
.hub-npc-pill {
  padding: 0.12rem 0.4rem;
  border-radius: 0.3rem;
  background: #b46cff;
  color: #1c0a33;
  font: 900 0.58rem/1.15 Inter, system-ui, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hub-npc-close {
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid rgba(255, 250, 240, 0.25);
  border-radius: 50%;
  background: transparent;
  color: #fffaf0;
  font: 400 1.2rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.hub-npc-switches { display: grid; gap: 0.4rem; }
.hub-npc-switch {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 0.6rem;
  background: rgba(255, 250, 240, 0.04);
  cursor: pointer;
}
.hub-npc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.hub-npc-switch .track {
  position: relative;
  width: 2.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.22);
  transition: background 0.16s ease;
}
.hub-npc-switch .track::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fffaf0;
  transition: transform 0.16s ease;
}
.hub-npc-switch input:checked + .track { background: #8d4de0; }
.hub-npc-switch input:checked + .track::after { transform: translateX(1rem); }
.hub-npc-switch input:focus-visible + .track { outline: 2px solid #f3c744; outline-offset: 2px; }
.hub-npc-switch input:disabled + .track { opacity: 0.55; }
.hub-npc-switch .copy { display: grid; gap: 0.1rem; }
.hub-npc-switch b { font: 700 0.82rem/1.2 Inter, system-ui, sans-serif; }
.hub-npc-switch small { color: rgba(255, 250, 240, 0.62); font: 500 0.7rem/1.3 Inter, system-ui, sans-serif; }
.hub-npc-dial { display: grid; gap: 0.3rem; padding: 0.45rem 0.55rem; border: 1px solid rgba(255, 250, 240, 0.12); border-radius: 0.55rem; }
.hub-npc-dial label { display: grid; gap: 0.1rem; }
.hub-npc-dial b { font: 700 0.82rem/1.2 Inter, system-ui, sans-serif; }
.hub-npc-dial small { color: rgba(255, 250, 240, 0.62); font: 500 0.7rem/1.3 Inter, system-ui, sans-serif; }
.hub-npc-dial .row { display: flex; align-items: center; gap: 0.6rem; }
.hub-npc-dial input[type="range"] { flex: 1; min-width: 0; accent-color: #8d4de0; }
.hub-npc-dial input[type="range"]:disabled { opacity: 0.5; }
.hub-npc-dial output { min-width: 2.2rem; text-align: right; color: #f3c744; font: 800 0.86rem/1 Inter, system-ui, sans-serif; }
.hub-npc-note { margin: 0; color: #9ee6bd; font: 600 0.74rem/1.3 Inter, system-ui, sans-serif; }
.hub-npc-note:empty { display: none; }
.hub-npc-note.warn { color: #ffb08f; }
.hub-npc-count { margin: 0; color: #f3c744; font: 700 0.76rem/1.2 Inter, system-ui, sans-serif; }
.hub-npc-filter {
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 250, 240, 0.06);
  color: #fffaf0;
  font: 500 0.8rem/1.2 Inter, system-ui, sans-serif;
}
.hub-npc-list {
  display: grid;
  gap: 0.15rem;
  min-height: 4rem;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.hub-npc-list li {
  display: grid;
  grid-template-columns: 0.6rem minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.28rem 0.4rem;
  border-radius: 0.4rem;
  font: 500 0.76rem/1.2 Inter, system-ui, sans-serif;
}
.hub-npc-list li i { width: 0.5rem; height: 0.5rem; align-self: center; border-radius: 50%; background: #5b5b6e; }
.hub-npc-list li.online i { background: #f3c744; }
.hub-npc-list li.here i { background: #5fe3a1; box-shadow: 0 0 5px #5fe3a1; }
.hub-npc-list li.here { background: rgba(95, 227, 161, 0.08); }
.hub-npc-list li.off { color: rgba(255, 250, 240, 0.45); }
.hub-npc-list li b { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.hub-npc-list li small { color: #f3c744; font-weight: 700; }
.hub-npc-list li span { color: rgba(255, 250, 240, 0.62); font-size: 0.7rem; }
body.hub-phone .hub-npc-panel { top: auto; bottom: 0.6rem; width: calc(100vw - 1.2rem); max-height: 62%; }
body.hub-phone .hub-npc-admin { padding: 0.5rem 0.6rem; }
