/* The Hub (src/ui/modals/modal-hub.js; TabTibia 2026-10-11, "el hub ese nuevo"; r107 its own views in the same frame):
   the header ("‹ Hub", the title, ◐ see-through and ✕), the state of the account, the sections of tiles (the icon over its
   title and line) and the views (tabs, rows with bars, cards, lists). Fixed to the page and centred like the shop
   (css/shop.css: the game screen would clip it), four columns on the desktop and on the phone (body.force-mobile) */

#hub-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 620px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  box-sizing: border-box;
  color: #ddd;
}

/* The header of the modals (css/modal.css .modal-header) without its class, which ModalManager makes draggable: the hub
   is fixed to the middle of the page */
#hub-modal .hub-header {
  background-image: url("/png/bg2.png");
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 24px;
  font-weight: bold;
}

#hub-modal .hub-header-button {
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  cursor: pointer;
}

#hub-modal #hub-back {
  position: absolute;
  left: 4px;
  top: 3px;
}

#hub-modal .hub-header-right {
  position: absolute;
  right: 4px;
  top: 3px;
  display: flex;
  gap: 4px;
}

#hub-modal #hub-body {
  max-height: calc(100vh - 72px);
  overflow-y: auto;
}

/* See-through (◐): the frame stays and the game shows behind a dark veil; the tiles, rows and texts keep their full
   colour, with a backing of their own and an outline (TabTibia r124, user 2026-10-12: "se ve mal en modo
   claro/transparente ... no se aprecia nada bien": the whole body at 55 % opacity washed its texts and icons out over a
   bright floor) */
#hub-modal.hub-see-through {
  background: none;
  box-shadow: none;
}

#hub-modal.hub-see-through #hub-body {
  background: rgba(8, 6, 4, 0.5);
  text-shadow: 0 0 2px #000, 1px 1px 1px #000;
}

#hub-modal.hub-see-through .hub-tile,
#hub-modal.hub-see-through .hub-row,
#hub-modal.hub-see-through .hub-status,
#hub-modal.hub-see-through .hub-section,
#hub-modal.hub-see-through .hub-task-box,
#hub-modal.hub-see-through .hub-empty,
#hub-modal.hub-see-through .hub-note,
#hub-modal.hub-see-through .hub-task-footer {
  background-color: rgba(10, 10, 10, 0.78);
}

/* Home: the state of the account, the sections and the tiles */
#hub-modal .hub-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: #cfcfcf;
}

#hub-modal .hub-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #777;
  flex: none;
}

#hub-modal .hub-dot.on {
  background: #4fd34f;
  box-shadow: 0 0 4px #4fd34f;
}

#hub-modal .hub-account {
  color: #7fe07f;
  font-weight: bold;
}

#hub-modal .hub-separator {
  color: #666;
}

#hub-modal .hub-section {
  margin: 8px 0 4px;
  text-align: center;
  color: #c8a24a;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#hub-modal .hub-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

#hub-modal .hub-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 78px;
  padding: 6px 4px;
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid #000;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #4a4a4a;
  color: #e8e8e8;
  cursor: pointer;
  text-align: center;
}

#hub-modal .hub-tile:hover,
#hub-modal .hub-tile:focus-visible {
  box-shadow: inset 0 0 0 1px #c8a24a;
}

#hub-modal .hub-tile-icon {
  position: relative;
  width: 40px;
  height: 40px;
}

#hub-modal .hub-tile-icon canvas,
#hub-modal .hub-tile-icon img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}

#hub-modal .hub-level {
  position: absolute;
  right: -14px;
  bottom: -2px;
  padding: 0 3px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #c8a24a;
  border-radius: 3px;
  color: #f0d070;
  font-size: 9px;
  font-weight: bold;
  white-space: nowrap;
}

#hub-modal .hub-tile-title {
  margin-top: 3px;
  font-weight: bold;
  white-space: nowrap;
}

#hub-modal .hub-tile-line {
  min-height: 1.2em;
  max-width: 100%;
  color: #9fc2ff;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The views */
#hub-modal .hub-subtitle {
  margin-bottom: 6px;
  text-align: center;
  color: #f0d070;
  font-weight: bold;
}

#hub-modal .hub-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}

#hub-modal .hub-tab {
  flex: 1;
  padding: 4px;
  cursor: pointer;
}

#hub-modal .hub-tab.on {
  color: #fff;
  box-shadow: inset 0 -2px 0 #c8a24a;
}

#hub-modal .hub-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.6);
  background: none;
  color: #ddd;
  text-align: left;
}

#hub-modal button.hub-row {
  cursor: pointer;
}

#hub-modal button.hub-row:hover {
  background: rgba(200, 162, 74, 0.12);
}

#hub-modal .hub-row-label {
  flex: 1;
  min-width: 0;
}

#hub-modal .hub-row-value {
  color: #f0d070;
  font-weight: bold;
}

#hub-modal .hub-off {
  color: #777;
}

#hub-modal .hub-off .hub-row-value {
  color: #666;
}

#hub-modal .hub-bar {
  flex-basis: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #000;
}

#hub-modal .hub-bar-fill {
  height: 100%;
  background: #c8a24a;
}

#hub-modal .hub-creature canvas {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

#hub-modal .hub-health {
  flex-basis: 120px;
}

#hub-modal .hub-health .hub-bar-fill {
  background: #3fbf3f;
}

#hub-modal .hub-note,
#hub-modal .hub-empty {
  padding: 8px 6px;
  color: #999;
  font-size: 11px;
}

#hub-modal .hub-card {
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #111;
}

#hub-modal .hub-card-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 6px 8px;
  background: none;
  color: #e8e8e8;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
}

#hub-modal .hub-card-state {
  color: #9fc2ff;
  font-weight: normal;
}

#hub-modal .hub-card.done .hub-card-state {
  color: #7fe07f;
}

#hub-modal .hub-mission-name {
  padding: 2px 8px 0;
  color: #f0d070;
}

#hub-modal .hub-mission-text {
  padding: 0 8px 6px;
  color: #cfcfcf;
  font-size: 11px;
}

#hub-modal .hub-outfit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

#hub-modal .hub-outfit-canvas {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
}

#hub-modal .hub-action {
  margin-top: 8px;
  padding: 4px 12px;
  cursor: pointer;
}

#hub-modal .hub-private {
  display: flex;
  gap: 6px;
  padding: 8px 6px;
}

#hub-modal .hub-private input {
  flex: 1;
  min-width: 0;
}

/* The phone: the whole width, compact tiles in four columns, finger-sized rows */
body.force-mobile #hub-modal {
  width: calc(100vw - 16px);
}

body.force-mobile #hub-modal .hub-tile {
  min-height: 70px;
  padding: 5px 2px;
}

body.force-mobile #hub-modal .hub-tile-title {
  font-size: 11px;
}

body.force-mobile #hub-modal .hub-tile-line {
  font-size: 9px;
  white-space: normal;
  line-height: 1.1;
}

body.force-mobile #hub-modal .hub-row {
  min-height: 38px;
}

/* TabTibia r113: the Guild view (src/ui/modals/hub-guild.js) */
#hub-modal .hub-guild-head {
  display: grid;
  gap: 4px;
  padding: 6px;
}

#hub-modal .hub-guild-name {
  font-size: 15px;
  font-weight: bold;
  color: #f0d070;
}

#hub-modal .hub-guild-note {
  color: #bbb;
  font-size: 11px;
  overflow-wrap: anywhere;
}

#hub-modal .hub-guild-title {
  margin-top: 8px;
  padding: 3px 6px;
  color: #c8a24a;
  font-weight: bold;
  border-bottom: 1px solid rgba(200, 162, 74, 0.35);
}

#hub-modal .hub-guild-button {
  margin-top: 0;
  padding: 2px 8px;
}

#hub-modal .hub-guild-member .hub-private {
  padding: 4px 6px 8px 22px;
}

#hub-modal .hub-private[hidden] {
  display: none;
}

/* TabTibia r122: the Tasks view (src/ui/modals/hub-tasks.js): the tasks on the left, the chosen one on the right (one
   column on the phone) */
#hub-modal .hub-tasks {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

#hub-modal .hub-task-list {
  flex: 0 0 44%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#hub-modal .hub-task-search {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
}

#hub-modal .hub-task-rows {
  max-height: 330px;
  overflow-y: auto;
  box-shadow: inset 0 0 6px black;
}

#hub-modal .hub-task-row {
  flex-wrap: nowrap;
}

#hub-modal .hub-task-row.selected {
  background: rgba(200, 162, 74, 0.2);
  box-shadow: inset 2px 0 0 #c8a24a;
}

#hub-modal .hub-task-monster {
  image-rendering: pixelated;
  flex: none;
}

#hub-modal .hub-task-row .hub-task-monster {
  width: 32px;
  height: 32px;
}

#hub-modal .hub-task-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

#hub-modal .hub-task-name {
  font-weight: bold;
  color: #fff;
}

#hub-modal .hub-task-level,
#hub-modal .hub-task-status {
  font-size: 11px;
}

#hub-modal .hub-task-recommended { color: #3fdc3f; }
#hub-modal .hub-task-low { color: #d07070; }
#hub-modal .hub-task-active { color: #9f9dfd; }
#hub-modal .hub-task-complete { color: #f0d070; }
#hub-modal .hub-task-done { color: #888; }

#hub-modal .hub-task-detail {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#hub-modal .hub-task-box {
  border: 1px solid rgba(0, 0, 0, 0.7);
  box-shadow: inset 0 0 6px black;
}

#hub-modal .hub-task-box-title {
  padding: 2px 6px;
  text-align: center;
  font-weight: bold;
  color: #fff;
  background-image: url("/png/bg2.png");
}

#hub-modal .hub-task-box-body {
  padding: 6px;
  text-align: center;
  color: #ddd;
}

#hub-modal .hub-task-monsters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

#hub-modal .hub-task-monster-one {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
}

#hub-modal .hub-task-monster-one .hub-task-monster {
  width: 40px;
  height: 40px;
}

#hub-modal .hub-task-progress {
  height: 8px;
  margin-top: 4px;
}

#hub-modal .hub-task-progress .hub-bar-fill {
  background: #b32020;
}

#hub-modal .hub-task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

#hub-modal .hub-task-note {
  width: 100%;
  text-align: center;
  color: #999;
  font-size: 11px;
}

#hub-modal .hub-task-footer {
  margin-top: 6px;
  color: #999;
  font-size: 11px;
}

body.force-mobile #hub-modal .hub-tasks {
  flex-direction: column;
}

body.force-mobile #hub-modal .hub-task-list,
body.force-mobile #hub-modal .hub-task-detail {
  flex-basis: auto;
  width: 100%;
}

body.force-mobile #hub-modal .hub-task-rows {
  max-height: 180px;
}

/* TabTibia r124: the chosen task of a see-through Hub keeps a dark backing of its own over a bright floor */
#hub-modal.hub-see-through .hub-task-row.selected {
  background: rgba(46, 36, 14, 0.88);
}

/* r190 (user 2026-11-02: "Tasks, battle, la mayoria de pestañas dentro del hub parecen las antiguas y las de settings
   tambien, ayer te mande un ejemplo de como debia verse de minibia"): the Hub and all its views on every device take the
   look of the other windows (css/desktop-windows.css, css/npc-dialog.css): the dark panel without the stone texture, a
   title bar of 34 px in bold Verdana, dark buttons with the chosen tab and the hover in gold */
#hub-modal {
  background: rgba(38, 37, 35, 0.97);
  border: 1px solid #0c0c0c;
  outline: 1px solid #4a4741;
  border-radius: 3px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
  color: #ece6d6;
  font-family: Verdana, Arial, sans-serif;
}

#hub-modal .hub-header {
  min-height: 34px;
  padding: 0 4px;
  background: linear-gradient(180deg, rgba(60, 58, 54, 0.9), rgba(40, 39, 36, 0.9));
  border-bottom: 1px solid #0c0c0c;
  font: bold 14px Verdana, Arial, sans-serif;
  color: #f4efe2;
}

#hub-modal #hub-back,
#hub-modal .hub-header-right {
  top: 4px;
}

#hub-modal .hub-header-button,
#hub-modal .hub-tab,
#hub-modal .hub-action,
#hub-modal .hub-private input,
#hub-modal input.hub-task-search {
  background: #1b1a18;
  border: 1px solid #0c0c0c;
  box-shadow: inset 0 0 0 1px #3d3a34;
  border-radius: 4px;
  color: #ece6d6;
  font-family: Verdana, Arial, sans-serif;
  text-shadow: none;
}

#hub-modal .hub-header-button {
  min-width: 26px;
  height: 26px;
  font-weight: bold;
}

#hub-modal .hub-header-button:hover,
#hub-modal .hub-tab:hover,
#hub-modal .hub-action:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1px #d9a72c;
  color: #fff;
}

#hub-modal .hub-tab.on {
  color: #f0c24b;
  box-shadow: inset 0 0 0 1px #c9a13b;
}

#hub-modal .hub-action.hub-task-button {
  color: #1b1405;
  background: #d9a72c;
  box-shadow: none;
}

#hub-modal .hub-task-box {
  background: rgba(24, 23, 22, 0.6);
  border: 1px solid #0c0c0c;
  border-radius: 4px;
  box-shadow: none;
}

#hub-modal .hub-task-box-title {
  background: rgba(60, 58, 54, 0.55);
  border-bottom: 1px solid #0c0c0c;
  font-size: 12px;
}

#hub-modal .hub-section {
  font-family: Verdana, Arial, sans-serif;
  letter-spacing: 1.5px;
}

#hub-modal.hub-see-through {
  background: none;
  outline: none;
  box-shadow: none;
}

/* Battle as Minibia's battle list: one box a creature, the name in the colour of its health over its bar with the
   numbers, the creature on the right; the target framed in red */
#hub-modal .hub-battle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 4px;
  padding: 4px 6px;
  box-sizing: border-box;
  background: rgba(16, 16, 15, 0.75);
  border: 1px solid #0c0c0c;
  box-shadow: inset 0 0 0 1px #3d3a34;
  border-radius: 2px;
  font-family: Verdana, Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

#hub-modal .hub-battle-row:hover {
  box-shadow: inset 0 0 0 1px #8a7334;
}

#hub-modal .hub-battle-row.target {
  box-shadow: inset 0 0 0 1px #e03030;
}

#hub-modal .hub-battle-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#hub-modal .hub-battle-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 #000;
}

#hub-modal .hub-battle-bar {
  position: relative;
  display: block;
  height: 14px;
  background: #0a0a0a;
  border: 1px solid #000;
}

#hub-modal .hub-battle-fill {
  position: absolute;
  inset: 0 auto 0 0;
}

#hub-modal .hub-battle-numbers {
  position: absolute;
  inset: 0;
  font: bold 10px/14px Verdana, Arial, sans-serif;
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
}

#hub-modal .hub-battle-row canvas {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

/* The Battle List Filter (src/ui/battle-filter.js), over everything, next to its "≡" */
#battle-filter {
  position: fixed;
  z-index: 50000;
  width: 230px;
  background: rgba(38, 37, 35, 0.98);
  border: 1px solid #0c0c0c;
  outline: 1px solid #4a4741;
  border-radius: 3px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
  font-family: Verdana, Arial, sans-serif;
  color: #ece6d6;
}

#battle-filter .battle-filter-header {
  position: relative;
  height: 34px;
  padding: 0 40px 0 10px;
  line-height: 34px;
  background: linear-gradient(180deg, rgba(60, 58, 54, 0.9), rgba(40, 39, 36, 0.9));
  border-bottom: 1px solid #0c0c0c;
  font-weight: bold;
  font-size: 13px;
}

#battle-filter .battle-filter-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  padding: 0;
  background: #1d1c1a;
  border: 1px solid #55514a;
  border-radius: 3px;
  color: #e9e4d8;
  font-size: 13px;
  cursor: pointer;
}

#battle-filter .battle-filter-close:hover {
  border-color: #d9a72c;
  color: #fff;
}

#battle-filter .battle-filter-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 12px;
}

#battle-filter .battle-filter-section {
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9a9384;
}

#battle-filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

#battle-filter input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #d9a72c;
}

body.force-mobile #battle-filter label {
  min-height: 36px;
  font-size: 15px;
}

body.force-mobile #battle-filter input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

#battle-window .battle-filter-button {
  margin-left: auto;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  line-height: 14px;
  cursor: pointer;
}
