/* MISSÕES — modal do topo. Layout em três níveis (Diárias/Semanais/Tarefas)
   com cartões de progresso e recompensas. Segue a referência das prints. */

.missions-overlay {
  z-index: 3400;
}

.missions-box {
  width: min(760px, 96vw);
  max-height: 90vh;
  max-height: 90dvh;
  padding: 0;
  overflow: hidden auto;
  border: 1px solid rgba(64, 196, 255, 0.22);
  border-radius: 14px;
  background:
    radial-gradient(140% 90% at 12% 0%, rgba(27, 82, 128, 0.4), transparent 58%),
    linear-gradient(180deg, #0d1b2d 0%, #091321 52%, #060b13 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  color: #dcebf7;
}

.ms-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px 10px;
  border-bottom: 1px solid rgba(111, 232, 255, 0.08);
  background: linear-gradient(110deg, rgba(14, 48, 82, 0.82), rgba(10, 22, 38, 0.42));
}

.ms-title {
  flex: 1;
  min-width: 0;
}

.ms-title-kicker {
  display: block;
  color: #5fd4ee;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1;
}

.ms-title-main {
  margin: 3px 0 0;
  color: #f2fbff;
  font-size: clamp(20px, 4vw, 28px);
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 0 16px rgba(80, 200, 255, 0.28);
}

.ms-currency {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 12px 4px 8px;
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: 999px;
  background: rgba(4, 16, 28, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ms-currency-icon {
  width: 22px;
  height: 24px;
  object-fit: contain;
  image-rendering: pixelated;
}

.ms-currency-value {
  color: #eafff5;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ms-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(7, 14, 22, 0.7);
  color: #9fb3c8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ms-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.ms-tabs {
  display: flex;
  align-items: stretch;
  padding: 0 14px;
  border-bottom: 1px solid rgba(6, 182, 212, 0.14);
  background: rgba(8, 17, 29, 0.5);
}

.ms-tab {
  position: relative;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #8fa6ba;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ms-tab:hover {
  color: #cfe9ff;
}

.ms-tab.on {
  color: #6fe8ff;
  border-bottom-color: #37c7e8;
}

.ms-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5a5a;
  box-shadow: 0 0 7px rgba(255, 90, 90, 0.8);
}

.ms-tab-dot[hidden] {
  display: none;
}

.ms-feedback {
  margin: 8px 16px 0;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.ms-feedback.error {
  border: 1px solid rgba(248, 113, 113, 0.36);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

.ms-feedback.ok {
  border: 1px solid rgba(46, 204, 113, 0.32);
  background: rgba(46, 204, 113, 0.09);
  color: #a7f3c7;
}

.ms-content {
  padding: 10px 16px 4px;
}

.ms-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.ms-subtab {
  flex: 1;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: #8fa6ba;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ms-subtab:hover {
  color: #d9f3ff;
  border-color: rgba(6, 182, 212, 0.35);
}

.ms-subtab.on {
  border-color: rgba(6, 182, 212, 0.6);
  background: rgba(6, 182, 212, 0.12);
  color: #7de9ff;
}

.ms-card {
  margin-bottom: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(14, 29, 46, 0.92), rgba(9, 20, 33, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.ms-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ms-card-title {
  color: #eaf6ff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.ms-card-sub {
  margin-top: 3px;
  color: #9fb3c8;
  font-size: 11px;
  line-height: 1.3;
}

.ms-status {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ms-status.done {
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: #7de3b0;
}

.ms-status.ready {
  background: rgba(55, 199, 232, 0.14);
  border: 1px solid rgba(55, 199, 232, 0.42);
  color: #7de9ff;
}

.ms-status.active {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9fb3c8;
}

.ms-status.waiting {
  background: rgba(255, 211, 77, 0.08);
  border: 1px solid rgba(255, 211, 77, 0.22);
  color: #e8cd82;
}

.ms-status.available {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.22);
  color: #8feaff;
}

.ms-daily-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ms-daily-art {
  flex: 0 0 64px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 45%, rgba(6, 182, 212, 0.12), transparent 70%);
}

.ms-species-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}

.ms-daily-info {
  flex: 1;
  min-width: 0;
}

.ms-daily-species {
  color: #f2fbff;
  font-size: 14px;
  font-weight: 800;
}

.ms-daily-desc {
  margin: 1px 0 7px;
  color: #9fb3c8;
  font-size: 11px;
}

.ms-progress-text {
  margin-top: 4px;
  color: #8fa6ba;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ms-bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.ms-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #35c7e8, #6ef0c0);
  transition: width 0.25s ease;
}

.ms-bar.done .ms-bar-fill {
  background: linear-gradient(90deg, #2ecc71, #7de3b0);
}

.ms-bar.weekly .ms-bar-fill {
  background: linear-gradient(90deg, #7c5cff, #b28cff);
}

.ms-card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ms-reward {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ms-reward-label {
  margin-right: 2px;
  color: #7f93a6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ms-reward-xp {
  color: #61dafb;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ms-reward-token,
.ms-reward-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #dcebf7;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ms-reward-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  image-rendering: pixelated;
  flex: 0 0 auto;
}

.ms-icon-fallback {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #8fb4cc;
  font-size: 8px;
  font-weight: 800;
}

.ms-token-gold {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #1a1a1a 0 34%, #ffd75e 36% 62%, #b8860b 64% 100%);
  border: 1px solid rgba(255, 215, 94, 0.65);
  box-shadow: 0 0 6px rgba(255, 215, 94, 0.22);
}

.ms-vip-badge {
  margin-left: auto;
  opacity: 1;
  padding: 3px 8px;
  border: 1px solid rgba(255, 211, 77, 0.4);
  border-radius: 999px;
  background: rgba(255, 211, 77, 0.08);
  color: #ffd75e;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.ms-vip-badge.off {
  opacity: 0.55;
  filter: saturate(0.55);
}

.ms-action {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 14px;
  border: 1px solid rgba(143, 234, 255, 0.5);
  border-radius: 5px;
  background: rgba(6, 182, 212, 0.12);
  color: #8feaff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.ms-action:hover:not(:disabled) {
  background: rgba(6, 182, 212, 0.22);
  border-color: #8feaff;
}

.ms-action.primary {
  border-color: #37c7e8;
  background: linear-gradient(180deg, #37c7e8, #0e9fc4);
  color: #04161f;
}

.ms-action.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ms-action.small {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 10px;
}

.ms-action:disabled {
  filter: grayscale(0.4);
  opacity: 0.5;
  cursor: not-allowed;
}

.ms-weekly-objectives {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ms-objective {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ms-objective-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ms-objective-label {
  color: #cfe0ee;
  font-size: 11px;
  font-weight: 700;
}

.ms-objective-count {
  color: #8fa6ba;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ms-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 8px;
}

.ms-stat {
  padding: 10px 8px;
  border: 1px solid rgba(6, 182, 212, 0.16);
  border-radius: 8px;
  background: rgba(10, 24, 39, 0.75);
  text-align: center;
}

.ms-stat-value {
  display: block;
  color: #61dafb;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ms-stat-label {
  display: block;
  margin-top: 3px;
  color: #8fa6ba;
  font-size: 9px;
  line-height: 1.3;
}

.ms-hint {
  margin: 4px 0 10px;
  color: #8fa6ba;
  font-size: 10px;
  line-height: 1.45;
}

.ms-milestone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(10, 22, 36, 0.82);
}

.ms-milestone-main {
  flex: 1;
  min-width: 0;
}

.ms-milestone-title {
  margin-bottom: 5px;
  color: #eaf6ff;
  font-size: 12px;
  font-weight: 800;
}

.ms-milestone-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.ms-milestone-side .ms-reward {
  justify-content: flex-end;
}


.ms-task-title-wrap {
  min-width: 0;
}

.ms-task-npc {
  color: #eaf6ff;
  font-size: 13px;
  font-weight: 800;
}

.ms-task-city {
  color: #8fa6ba;
  font-size: 10px;
  font-weight: 600;
}

.ms-task-region {
  margin-top: 2px;
  color: #6f8398;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ms-task-objectives {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ms-task-kind {
  color: #7f93a6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 8px 3px 4px;
  border: 1px solid rgba(255, 90, 90, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.ms-chip.done {
  border-color: rgba(46, 204, 113, 0.45);
  background: rgba(46, 204, 113, 0.07);
}

.ms-chip-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
  flex: 0 0 auto;
}

.ms-chip-name {
  max-width: 110px;
  overflow: hidden;
  color: #dcebf7;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-chip-count {
  color: #8fa6ba;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ms-chip.done .ms-chip-count {
  color: #7de3b0;
}

.ms-task-action {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.ms-accept-all-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 0 0 10px;
  padding: 0;
}

.ms-accept-all {
  min-width: 150px;
}

.ms-renew {
  margin: 10px 0 4px;
  color: #7f93a6;
  font-size: 10px;
  font-style: italic;
  text-align: center;
}

.ms-footer {
  padding: 8px 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ms-footer-note {
  color: #7f93a6;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.ms-empty,
.ms-loading {
  padding: 32px 12px;
  color: #8fa6ba;
  font-size: 12px;
  text-align: center;
}

/* Ponto vermelho no botão Missões da topbar. */
.missions-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(7, 12, 18, 0.9);
  border-radius: 50%;
  background: #ff5a5a;
  box-shadow: 0 0 7px rgba(255, 90, 90, 0.8);
}

.missions-dot[hidden] {
  display: none;
}

#missions-btn {
  position: relative;
}

#missions-btn.missions-ready {
  color: #ffd75e;
  border-color: rgba(255, 215, 94, 0.4);
}

@media (max-width: 700px) {
  .missions-box {
    width: min(96vw, 600px);
    max-height: 94dvh;
  }

  .ms-head {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 10px 12px 8px;
    border-radius: 0;
    background: linear-gradient(110deg, rgba(14, 48, 82, 0.98), rgba(10, 22, 38, 0.98));
  }

  .ms-content {
    padding: 8px 12px 4px;
  }

  .ms-tabs {
    padding: 0 8px;
  }

  .ms-tab {
    font-size: 11px;
  }

  .ms-daily-body {
    gap: 8px;
  }

  .ms-daily-art {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
  }

  .ms-daily-art .ms-species-img {
    width: 50px;
    height: 50px;
  }

  .ms-card-foot {
    align-items: flex-start;
  }

  .ms-reward {
    flex-basis: 100%;
  }

  .ms-vip-badge {
    margin-left: 0;
  }

  .ms-card-foot .ms-action {
    margin-left: auto;
  }

  .ms-milestone {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .ms-milestone-side {
    align-items: stretch;
  }

  .ms-milestone-side .ms-reward {
    justify-content: flex-start;
  }

  .ms-chip-name {
    max-width: 84px;
  }

  .ms-subtabs {
    overflow-x: auto;
  }

  .ms-subtab {
    flex: 0 0 auto;
    min-width: 96px;
  }

  .ms-footer {
    padding-bottom: 10px;
  }
}

@media (max-height: 520px) {
  .missions-box {
    max-height: 96dvh;
  }

  .ms-head {
    padding-top: 8px;
    padding-bottom: 6px;
  }

  .ms-tab {
    min-height: 38px;
  }

  .ms-card {
    margin-bottom: 7px;
  }
}

/* Gold (balance) nas recompensas. */
.ms-reward-gold {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #ffd75e;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Escolha das opções diárias. */
.ms-daily-options .ms-hint {
  margin: 0 0 4px;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ms-option-art {
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 45%, rgba(6, 182, 212, 0.12), transparent 70%);
}

.ms-option-art .ms-species-img {
  width: 42px;
  height: 42px;
}

.ms-option-info {
  flex: 1;
  min-width: 130px;
}

.ms-option-name {
  color: #f2fbff;
  font-size: 13px;
  font-weight: 800;
}

.ms-option-meta {
  margin-top: 2px;
  color: #8fa6ba;
  font-size: 10px;
}

.ms-option .ms-reward {
  flex: 1 1 220px;
  justify-content: flex-end;
}

.ms-option-side {
  flex: 0 0 auto;
  margin-left: auto;
}

/* Busca e paginação das tarefas. */
.ms-task-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.ms-search-wrap {
  flex: 1 1 210px;
  min-width: 180px;
}

.ms-search {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 6px 10px 6px 30px;
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: 6px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%238fa6ba' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E")
      no-repeat 10px center,
    rgba(4, 14, 24, 0.72);
  color: #eaf6ff;
  font-family: inherit;
  font-size: 11px;
}

.ms-search::placeholder {
  color: #70879c;
}

.ms-search:focus {
  outline: none;
  border-color: #37c7e8;
  box-shadow: 0 0 0 1px rgba(55, 199, 232, 0.25);
}

.ms-task-meta {
  color: #8fa6ba;
  font-size: 10px;
  white-space: nowrap;
}

.ms-task-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.ms-page-btn {
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: #b9d4e8;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.ms-page-btn:hover:not(:disabled) {
  border-color: #37c7e8;
  color: #8feaff;
}

.ms-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ms-page-label {
  color: #8fa6ba;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .ms-option {
    flex-wrap: wrap;
  }

  .ms-option-info {
    flex: 1;
  }

  .ms-option .ms-reward {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .ms-option-side {
    margin-left: auto;
  }

  .ms-task-pager {
    margin-left: 0;
  }
}
