@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

html,
body {
  margin: 0;
  background: transparent;
  overflow: hidden;
}

.mission {
  --accent: #ffb020;
  --accent-soft: rgba(255, 176, 32, 0.18);
  --card: rgba(18, 18, 24, 0.86);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.7);
  --scale: 1;

  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.8em;
  padding: 2.4em;
  box-sizing: border-box;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: calc(22px * var(--scale));
  color: var(--text);
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  transition: opacity 400ms ease;
}
.mission[data-pos$='-left'] { align-items: flex-start; }
.mission[data-pos^='bottom-'] { justify-content: flex-end; }
.mission.stale { opacity: 0.45; }
.mission [hidden] { display: none !important; }

.card {
  position: relative;
  width: 19em;
  padding: 0.9em 1.1em 1em;
  border-radius: 1.1em;
  background: var(--card);
  box-shadow: 0 0.6em 2em rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  animation: enter 460ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
.card.leaving { animation: leave 320ms ease-in both; }
.card[data-result='success'],
.card[data-result='win'] { box-shadow: 0 0.6em 2em rgba(0, 0, 0, 0.35), inset 0 0 0 2px var(--accent); }

.head {
  display: flex;
  align-items: center;
  gap: 0.5em;
  line-height: 1.3;
}
.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.8em;
  height: 1.8em;
  border-radius: 0.5em;
  background: var(--accent-soft);
  color: var(--accent);
}
.icon svg { width: 62%; height: 62%; }
.names {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.kind { font-weight: 700; }
.titled .kind { color: var(--muted); font-size: 0.8em; }
.title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.badge {
  flex: none;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  background: var(--accent);
  color: #141418;
  font-size: 0.85em;
  font-weight: 800;
  animation: pop 420ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.card[data-result='fail'] .badge,
.card[data-result='draw'] .badge,
.card[data-result='settled'] .badge {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.amount {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
  margin-top: 0.45em;
  line-height: 1.1;
}
.num {
  font-size: 2.1em;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.card[data-result='fail'] .num { color: var(--muted); }
.unit { font-weight: 600; color: var(--muted); }
.gain {
  margin-left: auto;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  opacity: 0;
}
.gain.on { animation: gain 1.8s ease-out both; }

.settled {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
  margin-top: 0.3em;
}
.slabel { font-weight: 600; color: var(--muted); }
.snum { font-weight: 800; font-variant-numeric: tabular-nums; }

.sponsors {
  margin: 0.7em 0 0;
  padding: 0.6em 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  list-style: none;
}
.sponsors li {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  line-height: 1.6;
}
.rank {
  flex: none;
  width: 1em;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.first .rank { color: var(--accent); }
.sponsors .nick {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.cnt {
  flex: none;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(0.8em) scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes leave {
  to { opacity: 0; transform: translateY(-0.5em) scale(0.97); }
}
@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes gain {
  0% { opacity: 0; transform: translateY(0.4em); }
  15% { opacity: 1; transform: none; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-0.3em); }
}

@media (prefers-reduced-motion: reduce) {
  .card, .card.leaving, .badge, .gain.on { animation-duration: 1ms; }
}
