.future-popup[hidden] { display: none; }
.future-popup__panel[hidden] { display: none; }

.future-popup {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: max(86px, 6.8vw) 20px max(92px, 7.8vw);
  background: rgba(7, 61, 67, .34);
  backdrop-filter: blur(7px) saturate(.92);
}

.future-popup__panel {
  width: min(1180px, calc(100vw - 40px));
  height: min(690px, calc(100dvh - max(178px, 14.6vw)));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 218, .94);
  border-radius: 30px;
  background:
    radial-gradient(circle at 14% 4%, rgba(255, 249, 218, .24), transparent 26%),
    linear-gradient(145deg, rgba(22, 157, 166, .97), rgba(15, 113, 126, .98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .48),
    inset 0 -14px 32px rgba(7, 61, 67, .12),
    0 28px 64px rgba(7, 61, 67, .34);
  color: #fff7d9;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
}

.future-popup__header {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 249, 218, .42);
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.future-popup__emblem {
  width: 66px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(7, 61, 67, .24));
}

.future-popup__heading { min-width: 0; }

.future-popup__heading h2 {
  margin: 0;
  color: #fff8df;
  font-size: clamp(22px, 2.1vw, 34px);
  line-height: 1;
  letter-spacing: -.02em;
  text-shadow: 0 3px 4px rgba(7, 61, 67, .34);
}

.future-popup__heading p {
  margin: 5px 0 0;
  color: rgba(255, 248, 223, .84);
  font-size: 13px;
  font-weight: 800;
}

.future-popup__header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.future-scope-badge,
.future-wallet {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(255, 249, 218, .76);
  border-radius: 999px;
  background: rgba(255, 248, 218, .12);
  color: #fff3bd;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.future-wallet {
  color: #fff8df;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.future-popup button { font: inherit; }

.future-popup__close,
.future-secondary-button,
.future-primary-button {
  min-height: 42px;
  border: 1px solid rgba(255, 249, 218, .76);
  border-radius: 14px;
  color: #fff8df;
  background: rgba(255, 255, 255, .1);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), background-color .18s ease;
}

.future-popup__close {
  flex: 0 0 42px;
  width: 42px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.future-secondary-button { padding: 8px 12px; }

.future-primary-button {
  width: 100%;
  padding: 10px 14px;
  border-color: rgba(255, 249, 218, .94);
  background: #e86b45;
  box-shadow: 0 9px 18px rgba(105, 54, 40, .22), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.future-popup__close:hover,
.future-secondary-button:hover { background: rgba(255, 255, 255, .18); }

.future-popup button:active { transform: scale(.98); }

.future-popup button:focus-visible {
  outline: 3px solid #fff4b8;
  outline-offset: 2px;
}

.future-popup__body {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.future-popup__body--bag,
.future-popup__body--missions {
  grid-template-columns: 176px minmax(0, 1fr) 310px;
}

.future-categories,
.future-workspace,
.future-detail {
  min-height: 0;
  border: 1px solid rgba(255, 249, 218, .52);
  border-radius: 20px;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.future-popup__body--missions .future-detail {
  grid-template-rows: auto auto auto auto auto auto auto;
}

.future-categories {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.future-category {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 248, 223, .82);
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.future-category img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.future-category span:last-child {
  min-width: 34px;
  text-align: right;
  color: #ffe58a;
}

.future-category.is-active {
  border-color: rgba(255, 249, 218, .86);
  background: rgba(255, 247, 213, .17);
  color: #fff8df;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.future-workspace {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  overflow: auto;
  scrollbar-width: thin;
}

.future-section-label {
  margin: 0;
  color: #fff1b6;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.future-bag__quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.future-slot {
  min-height: 74px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255, 249, 218, .45);
  border-radius: 15px;
  background: rgba(7, 61, 67, .13);
}

.future-slot img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.future-slot strong,
.future-slot span { display: block; }
.future-slot strong { color: #fff8df; font-size: 11px; line-height: 1.1; }
.future-slot span { margin-top: 3px; color: #ffe58a; font-size: 9px; font-weight: 900; }
.future-slot--empty { grid-template-columns: 1fr; place-items: center; border-style: dashed; color: rgba(255, 248, 223, .76); font-size: 11px; font-weight: 900; }

.future-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.future-item-card {
  min-height: 82px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(255, 249, 218, .38);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  color: #fff8df;
  text-align: left;
  cursor: pointer;
}

.future-item-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.future-item-card strong,
.future-item-card span { display: block; }
.future-item-card strong { font-size: 12px; line-height: 1.12; }
.future-item-card span { margin-top: 4px; color: rgba(255, 248, 223, .72); font-size: 10px; font-weight: 850; }
.future-item-card.is-selected { border-color: rgba(255, 249, 218, .9); background: rgba(255, 247, 213, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24); }
.future-item-card.is-selected span { color: #ffe58a; }

.future-detail {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 9px;
  padding: 14px;
  overflow: auto;
  background: rgba(255, 248, 223, .94);
  color: #17454c;
}

.future-detail__hero {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.future-detail__hero img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(7, 61, 67, .16));
}

.future-detail__tag {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(232, 107, 69, .13);
  color: #ad4e35;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.future-detail h3 { margin: 0; color: #133f47; font-size: 20px; line-height: 1.05; }
.future-detail p { margin: 0; color: #315d62; font-size: 11px; line-height: 1.35; font-weight: 780; }
.future-detail__count { color: #ad4e35 !important; font-weight: 950 !important; }
.future-detail__rule { padding: 9px; border-left: 4px solid #e86b45; border-radius: 10px; background: rgba(232, 107, 69, .09); }

.future-popup__footer-note {
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid rgba(255, 249, 218, .36);
  color: rgba(255, 248, 223, .78);
  background: rgba(7, 61, 67, .11);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.future-mission-list {
  display: grid;
  gap: 8px;
}

.future-mission-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(255, 249, 218, .38);
  border-radius: 16px;
  background: rgba(255, 255, 255, .06);
  color: #fff8df;
  text-align: left;
  cursor: pointer;
}

.future-mission-card img { width: 58px; height: 58px; object-fit: contain; }
.future-mission-card strong,
.future-mission-card span { display: block; }
.future-mission-card strong { font-size: 12px; line-height: 1.14; }
.future-mission-card span { margin-top: 3px; color: rgba(255, 248, 223, .72); font-size: 10px; font-weight: 850; }
.future-mission-card b { color: #ffe58a; font-size: 12px; font-variant-numeric: tabular-nums; }
.future-mission-card.is-selected { border-color: rgba(255, 249, 218, .9); background: rgba(255, 247, 213, .16); }

.future-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(7, 61, 67, .16);
  box-shadow: inset 0 1px 2px rgba(7, 61, 67, .16);
}

.future-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0a52f, #e86b45);
}

.future-reward {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(240, 165, 47, .13);
}

.future-reward img { width: 62px; height: 62px; object-fit: contain; }
.future-reward strong { display: block; color: #9c532b; font-size: 12px; }
.future-reward span { display: block; margin-top: 3px; color: #4d6869; font-size: 10px; font-weight: 850; }

.future-toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(104px, 8.5vw);
  width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 249, 218, .88);
  border-radius: 16px;
  background: rgba(20, 77, 82, .96);
  color: #fff8df;
  box-shadow: 0 16px 32px rgba(7, 61, 67, .28);
  font: 900 12px/1.3 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  text-align: center;
  transform: translate(-50%, 0);
}

.future-toast[hidden] { display: none; }

@media (max-width: 1040px), (max-height: 700px) {
  .future-popup { padding: 58px 10px 68px; }
  .future-popup__panel { width: calc(100vw - 20px); height: calc(100dvh - 126px); border-radius: 22px; }
  .future-popup__header { min-height: 58px; gap: 8px; padding: 7px 10px; }
  .future-popup__emblem { width: 46px; height: 46px; }
  .future-popup__heading h2 { font-size: 20px; }
  .future-popup__heading p { display: none; }
  .future-scope-badge { display: none; }
  .future-wallet { min-height: 30px; padding: 5px 8px; font-size: 10px; }
  .future-secondary-button { display: none; }
  .future-popup__close { flex-basis: 34px; min-height: 34px; width: 34px; border-radius: 11px; }
  .future-popup__body { gap: 8px; padding: 8px; }
  .future-popup__body--bag,
  .future-popup__body--missions { grid-template-columns: minmax(0, 1.15fr) minmax(240px, .85fr); }
  .future-categories { grid-column: 1 / -1; display: flex; padding: 6px; overflow-x: auto; }
  .future-category { min-width: 116px; min-height: 40px; grid-template-columns: 28px minmax(0, 1fr) auto; padding: 4px 6px; }
  .future-category img { width: 28px; height: 28px; }
  .future-bag__quick { display: none; }
  .future-workspace,
  .future-detail { padding: 8px; border-radius: 15px; }
  .future-item-card,
  .future-mission-card { min-height: 60px; padding: 5px; }
  .future-item-card img,
  .future-mission-card img { width: 43px; height: 43px; }
  .future-item-card { grid-template-columns: 43px minmax(0, 1fr); }
  .future-mission-card { grid-template-columns: 43px minmax(0, 1fr) auto; }
  .future-detail__hero { grid-template-columns: 58px minmax(0, 1fr); }
  .future-detail__hero img { width: 58px; height: 58px; }
  .future-detail h3 { font-size: 16px; }
  .future-detail p { font-size: 9px; }
  .future-popup__body--missions .future-detail {
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    gap: 5px;
    overflow: hidden;
  }
  .future-popup__body--missions .future-detail__hero { grid-template-columns: 46px minmax(0, 1fr); }
  .future-popup__body--missions .future-detail__hero img { width: 46px; height: 46px; }
  .future-popup__body--missions [data-mission-detail-description] { display: none; }
  .future-popup__body--missions .future-reward { grid-template-columns: 44px minmax(0, 1fr); padding: 5px; }
  .future-popup__body--missions .future-reward img { width: 44px; height: 44px; }
  .future-popup__body--missions .future-detail__rule { padding: 6px; overflow: hidden; }
  .future-popup__body--missions .future-primary-button { min-height: 34px; padding: 6px 10px; }
  .future-popup__footer-note { display: none; }
}

@media (max-width: 680px) and (orientation: portrait) {
  .future-popup { padding: 68px 8px 84px; }
  .future-popup__panel { height: calc(100dvh - 152px); }
  .future-popup__body--bag,
  .future-popup__body--missions { grid-template-columns: 1fr; overflow-y: auto; }
  .future-categories { grid-column: auto; }
  .future-detail { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  .future-popup *,
  .future-toast { transition: none !important; animation: none !important; }
}
