/* =============================== */
/* MISSÕES - AJUSTE PÓS DASHBOARD */
/* =============================== */

body main {
  width: min(1000px, 100%);
  margin: 150px auto 0;
  padding: 30px 20px 120px;
  font-family: 'Poppins', sans-serif;
}

/* Título principal no estilo loja/dashboard */
body main > h1 {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 34px;
  padding: 0 18px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.6px;
  text-align: center;
  text-transform: none;
  color: #222;
}

body.dark-mode main > h1 {
  color: #fff;
}

body main > h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(120px, 70%);
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(145deg, #667eea, #764ba2);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
  transform: translateX(-50%);
}

/* =============================== */
/* Lista de missões                */
/* =============================== */

.mission-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mission-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  padding: 16px;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(102, 126, 234, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.3s ease;
}

.mission-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(102, 126, 234, 0.14), inset 0 0 0 1px rgba(102, 126, 234, 0.14);
}

body.dark-mode .mission-item {
  background: #2c2c2c;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.mission-img {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  object-fit: contain;
  border-radius: 18px;
  user-select: none;
}

.mission-text {
  flex: 1;
  min-width: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #222;
}

body.dark-mode .mission-text {
  color: #fff;
}

/* =============================== */
/* Botões de missão                */
/* =============================== */

.mission-btn {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  height: 36px;
  flex: 0 0 140px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  white-space: nowrap;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.22s ease, background 0.3s ease;
}

.mission-btn.off {
  background: linear-gradient(145deg, #cfcfcf, #aaa);
  color: #fff;
  cursor: default;
  box-shadow: none;
}

.mission-btn.available {
  background: linear-gradient(145deg, #88ff00, #6dc706);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(9, 255, 0, 0.55);
}

.mission-btn.available:hover {
  transform: translateY(-1px);
  opacity: 0.95;
  box-shadow: 0 0 20px rgba(9, 255, 0, 0.7);
}

.mission-btn.claimed {
  background: linear-gradient(145deg, #FFD700, #FFA500);
  color: #111;
  font-weight: 900;
  cursor: default;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
}

/* =============================== */
/* Barra de progresso              */
/* =============================== */

.progress-container {
  width: 100%;
  height: 26px;
  margin: 28px 0 0;
  background-color: #ddd;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.06);
}

body.dark-mode .progress-container {
  background-color: #444;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(145deg, #6779e5, #7453ae);
  transition: width 0.5s ease;
}

/* Estrela final */
.final-star-container {
  text-align: right;
  margin-top: -38px;
  margin-bottom: 26px;
  padding-right: 8px;
  pointer-events: none;
}

.final-star-img {
  width: 58px;
  height: auto;
  transition: filter 0.3s, transform 0.25s ease;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
}

.final-star-img:hover {
  transform: scale(1.05);
}

#finalRewardBtn {
  display: block;
  margin: 16px auto 0;
}

/* Cronômetro */
.countdown {
  text-align: center;
  margin-top: 28px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
}

body.dark-mode .countdown {
  color: #eee;
}

/* =============================== */
/* Mensagem de prêmio resgatado    */
/* Toast no topo igual ao álbum    */
/* =============================== */

.reward-alert,
#rewardAlert,
.missions-toast {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 3000;
  max-width: 92vw;
  width: fit-content;
  margin: 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 0 0 20px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: #fff !important;
  background: linear-gradient(145deg, #667eea, #764ba2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  opacity: 1;
  transform: translate(-50%, -120%);
  pointer-events: none;
  transition: transform 0.35s ease;
}

.reward-alert.show,
#rewardAlert.show,
.missions-toast.show {
  color: #fff !important;
  transform: translate(-50%, 0%);
}

.reward-alert:empty,
#rewardAlert:empty,
.missions-toast:empty {
  display: none !important;
}

body.dark-mode .reward-alert,
body.dark-mode #rewardAlert,
body.dark-mode .missions-toast {
  color: #fff !important;
  background: linear-gradient(145deg, #556cd6, #5a3d7a);
}

/* =============================== */
/* Categorias das medalhas         */
/* =============================== */

.category-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  padding: 16px;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(102, 126, 234, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.3s ease;
}

.category-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(102, 126, 234, 0.14), inset 0 0 0 1px rgba(102, 126, 234, 0.14);
}

body.dark-mode .category-item {
  background: #2c2c2c;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.category-img {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  object-fit: contain;
  border-radius: 18px;
}

.category-text {
  flex: 1;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #222;
}

body.dark-mode .category-text {
  color: #fff;
}

/* Bolinha de notificação das categorias */
.category-notification-dot {
  top: 12px;
  right: 12px;
  z-index: 5;
}

/* =============================== */
/* Botão flutuante                 */
/* =============================== */

.floating-missions-btn {
  border-radius: 999px;
}

/* =============================== */
/* Responsividade                  */
/* =============================== */

@media (max-width: 768px) {
  body main {
    margin-top: 150px;
    padding: 20px 14px 110px;
  }

  body main > h1 {
    margin-bottom: 28px;
    padding-bottom: 12px;
    font-size: clamp(1.45rem, 7vw, 2.25rem);
    letter-spacing: -0.3px;
  }

  body main > h1::after {
    height: 4px;
    width: min(96px, 65%);
  }

  .mission-item,
  .category-item {
    padding: 14px;
    gap: 12px;
    border-radius: 16px;
  }

  .mission-img,
  .category-img {
    width: 66px;
    height: 66px;
    flex-basis: 66px;
    border-radius: 14px;
  }

  .mission-text,
  .category-text {
    font-size: 0.92rem;
  }

  .mission-btn {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    height: 34px;
    flex: 0 0 140px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .final-star-img {
    width: 52px;
  }

  .countdown {
    font-size: 0.95rem;
  }

  .reward-alert,
  #rewardAlert,
  .missions-toast {
    top: 0;
    max-width: 92vw;
    width: fit-content;
    padding: 12px 18px;
    font-size: 0.9rem;
    border-radius: 0 0 20px 20px;
  }
}

@media (max-width: 520px) {
  body main {
    margin-top: 150px;
    padding: 18px 12px 110px;
  }

  .mission-item {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .category-item {
    display: grid;
    grid-template-columns: 58px 1fr;
    grid-template-areas:
      "img text";
    align-items: center;
  }

  .mission-img,
  .category-img {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
  }

  .category-img {
    grid-area: img;
  }

  .mission-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  .category-text {
    grid-area: text;
  }

  .mission-btn {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    height: 34px;
    flex: 0 0 140px;
    margin-top: 0;
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .progress-container {
    height: 24px;
  }

  .final-star-container {
    margin-top: -35px;
    margin-bottom: 24px;
  }

  .final-star-img {
    width: 48px;
  }

  .reward-alert,
  #rewardAlert,
  .missions-toast {
    top: 0;
    width: fit-content;
    max-width: 92vw;
    padding: 12px 16px;
    font-size: 0.86rem;
    border-radius: 0 0 20px 20px;
  }
}