/* Elaris — page missions : bandeau de progression, cartes de mission, coffre du jour.
   Structure reprise du design Claude Design (templates/, 2026-09-14), traduite dans les tokens
   Afterglow : accent périwinkle, rayons courts, Jost. L'or du coffre reprend la teinte du tier
   Légendaire — la seule « couleur récompense » que le site connaisse déjà. */

.ms-eyebrow { font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-faint); }
.ms-eyebrow [data-reset-in] { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.ms-head .page-head { margin-top: var(--s2); }

/* ── Bandeau de progression ── */
.ms-hero {
  position: relative; overflow: hidden; padding: var(--s5); border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(58, 92, 150, 0.32), rgba(8, 12, 22, 0.75));
  border: 1px solid var(--border);
}
.ms-hero::after { /* halo discret, le « glow » du design sans concurrencer les cartes */
  content: ''; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; pointer-events: none;
  background: radial-gradient(circle, rgba(188, 215, 255, 0.12), transparent 65%);
}
.ms-hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; }
.ms-score { display: flex; align-items: baseline; gap: var(--s3); margin-top: var(--s3); flex-wrap: wrap; }
.ms-score strong { font-size: 2.6rem; font-weight: 500; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.ms-score-total { font-size: 1.35rem; color: var(--ink-faint); margin-left: -8px; }
.ms-hint { font-size: 0.85rem; color: var(--ink-dim); }

.ms-chest-box { position: relative; z-index: 1; text-align: right; }
.ms-chest-state { font-size: 0.66rem; letter-spacing: 0.18em; color: var(--ink-faint); }
.ms-hero.is-unlocked .ms-chest-state { color: var(--tier-l); }
.ms-hero.is-opened .ms-chest-state { color: var(--success); }
.ms-chest-btn { margin-top: var(--s2); min-height: 42px; border-radius: 11px; border: 1px solid var(--border); color: var(--ink-faint); cursor: not-allowed; }
.ms-chest-btn.is-ready {
  cursor: pointer; color: #1a1204; border-color: transparent;
  background: linear-gradient(180deg, #ffd27a, var(--tier-l)); box-shadow: 0 10px 28px rgba(255, 179, 64, 0.22);
}
.ms-chest-btn.is-ready:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(255, 179, 64, 0.3); }
.ms-chest-btn.is-opened { color: var(--success); border-color: rgba(143, 214, 165, 0.35); background: rgba(143, 214, 165, 0.08); cursor: default; }
.ms-earned { margin-top: var(--s2); font-size: 0.66rem; letter-spacing: 0.12em; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.ms-track {
  position: relative; margin: var(--s5) 11px 0; height: 10px; border-radius: var(--r-pill);
  background: rgba(5, 7, 13, 0.7); box-shadow: inset 0 0 0 1px var(--border);
}
.ms-track-fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent) 65%, var(--success));
  box-shadow: 0 0 20px rgba(188, 215, 255, 0.4); transition: width var(--t-slow) var(--ease-spring);
}
.ms-node {
  position: absolute; top: 50%; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.62rem; font-weight: 600; color: var(--ink-faint);
  background: var(--bg-deep); box-shadow: inset 0 0 0 2px var(--border-strong); transition: background var(--t-med), color var(--t-med);
}
.ms-node.is-reached { background: var(--accent); color: var(--bg); box-shadow: inset 0 0 0 2px #e3eeff; }
.ms-track-label { margin-top: var(--s3); text-align: right; font-size: 0.62rem; letter-spacing: 0.14em; color: var(--ink-faint); }
.ms-hero.is-unlocked .ms-track-label { color: var(--tier-l); }

/* ── Cartes de mission ── */
.ms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--s4); margin-top: var(--s5); }
.ms-card {
  position: relative; display: flex; flex-direction: column; padding: var(--s5); border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(20, 31, 54, 0.85), rgba(8, 12, 22, 0.85)); border: 1px solid var(--border);
  transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast), opacity var(--t-med);
}
.ms-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.ms-card.is-ready { background: linear-gradient(160deg, rgba(143, 214, 165, 0.1), rgba(8, 12, 22, 0.85)); border-color: rgba(143, 214, 165, 0.3); }
.ms-card.is-claimed { opacity: 0.6; }
.ms-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.ms-ico {
  width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center;
  color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--border);
}
.ms-card.is-ready .ms-ico { color: var(--success); background: rgba(143, 214, 165, 0.12); }
.ms-tag {
  padding: 4px 10px; border-radius: var(--r-pill); font-size: 0.6rem; letter-spacing: 0.14em; white-space: nowrap;
  color: var(--ink-dim); background: var(--accent-soft);
}
.ms-card.is-ready .ms-tag { color: var(--tier-l); background: rgba(255, 179, 64, 0.12); }
.ms-title { margin-top: var(--s4); font-size: 1.12rem; font-weight: 500; line-height: 1.2; letter-spacing: var(--track); color: var(--ink); text-wrap: pretty; }
.ms-desc { margin-top: var(--s1); font-size: 0.82rem; line-height: 1.5; color: var(--ink-dim); flex: 1; }
.ms-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s4); }
.ms-count { font-size: 0.72rem; letter-spacing: 0.1em; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.ms-reward { display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.ms-card.is-ready .ms-reward { color: var(--tier-l); }
.ms-card.is-claimed .ms-reward { color: var(--ink-dim); }
.ms-gem { width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); border-radius: 1px; }
.ms-bar { margin-top: var(--s2); height: 6px; border-radius: var(--r-pill); overflow: hidden; background: rgba(5, 7, 13, 0.7); box-shadow: inset 0 0 0 1px var(--border); }
.ms-fill { height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 12px rgba(188, 215, 255, 0.5); transition: width var(--t-slow) var(--ease-spring); }
.ms-card.is-ready .ms-fill, .ms-card.is-claimed .ms-fill { background: var(--success); box-shadow: 0 0 12px rgba(143, 214, 165, 0.45); }
.ms-act { margin-top: var(--s4); width: 100%; border-radius: 10px; }
.ms-act.is-ready { color: #1a1204; border: 1px solid transparent; background: linear-gradient(180deg, #ffd27a, var(--tier-l)); }
.ms-act.is-ready:hover { filter: brightness(1.06); }
.ms-act.is-claimed { color: var(--ink-faint); border: 1px solid var(--border); cursor: default; }

/* ── Bandeau partage ── */
.ms-share {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s5);
  padding: var(--s5); border-radius: var(--r-lg); background: rgba(8, 12, 22, 0.7); border: 1px solid var(--border);
}
.ms-share h2 { font-size: 1.05rem; }
.ms-share p { margin-top: var(--s1); font-size: 0.85rem; color: var(--ink-dim); }
/* Bouton « Copier le lien » : plein, arrondi, et il passe au vert quelques instants pour confirmer
   que le lien est bien dans le presse-papier (UX du design Claude Design). */
.ms-copy { min-width: 150px; border-radius: 10px; border: 1px solid transparent; color: var(--bg); background: var(--accent);
  transition: background var(--t-med) var(--ease-out), color var(--t-med) var(--ease-out), transform 100ms ease-out; }
.ms-copy:hover { background: #d6e7ff; }
.ms-copy.is-copied, .ms-copy.is-copied:hover { color: var(--success); background: rgba(143, 214, 165, 0.16); border-color: rgba(143, 214, 165, 0.3); }

/* ── Coffre du jour (modale) ── */
.ms-chest-modal {
  position: relative; width: min(540px, 100%); padding: var(--s6) var(--s5); text-align: center; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(20, 31, 54, 0.95), rgba(5, 7, 13, 0.96));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-2); animation: modal-in var(--t-med) var(--ease-spring);
}
.ms-chest-idle { display: flex; flex-direction: column; align-items: center; gap: var(--s5); margin-top: var(--s5); }
.ms-chest-art { position: relative; width: 168px; height: 148px; animation: ms-chest-float 2.8s ease-in-out infinite; }
.ms-chest-glow { position: absolute; inset: -22px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 179, 64, 0.35), transparent 68%); animation: ms-glow 2.4s ease-in-out infinite; }
.ms-chest-body { position: absolute; left: 8px; right: 8px; top: 52px; bottom: 0; border-radius: 8px 8px 12px 12px; background: linear-gradient(180deg, #7d5d27, #3e2a0f); box-shadow: inset 0 0 0 2px var(--tier-l), inset 0 -14px 26px rgba(0, 0, 0, 0.45); }
.ms-chest-lid { position: absolute; left: 4px; right: 4px; top: 6px; height: 60px; border-radius: 28px 28px 6px 6px; transform-origin: 50% 100%; background: linear-gradient(180deg, #b98c3d, #6b4d1c); box-shadow: inset 0 0 0 2px var(--tier-l), inset 0 10px 20px rgba(255, 255, 255, 0.12); transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.ms-chest-lock { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); width: 32px; height: 32px; border-radius: var(--r-md); background: linear-gradient(160deg, #ffe0a3, #c9922f); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.ms-chest-art:hover .ms-chest-lid { transform: rotateX(-20deg); }
@keyframes ms-chest-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(-1deg); } }
@keyframes ms-glow { 0%, 100% { opacity: 0.6; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }

.ms-reel { position: relative; overflow: hidden; margin-top: var(--s5); padding: var(--s4) 0; border-radius: var(--r-lg); background: rgba(5, 7, 13, 0.75); box-shadow: inset 0 0 0 1px var(--border); }
.ms-reel::before, .ms-reel::after { content: ''; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 3; pointer-events: none; }
.ms-reel::before { left: 0; background: linear-gradient(90deg, rgba(5, 7, 13, 0.95), transparent); }
.ms-reel::after { right: 0; background: linear-gradient(270deg, rgba(5, 7, 13, 0.95), transparent); }
.ms-reel-marker { position: absolute; top: 0; bottom: 0; left: 50%; width: 128px; transform: translateX(-50%); z-index: 2; pointer-events: none; border-radius: var(--r-lg); box-shadow: inset 0 0 0 2px rgba(255, 179, 64, 0.75), 0 0 24px rgba(255, 179, 64, 0.2); }
.ms-reel-strip { display: flex; gap: 12px; will-change: transform; }
.ms-reel-item, .ms-prize-tile {
  --c: var(--accent); flex: 0 0 116px; height: 124px; border-radius: var(--r-md); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--s2); color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: inset 0 0 0 1px var(--border);
}
.ms-reel-item span, .ms-prize-tile span { font-size: 1.6rem; line-height: 1; }
.ms-reel-item strong { font-size: 0.72rem; font-weight: 600; }
.ms-t-crystals { --c: var(--accent); }
.ms-t-packs { --c: var(--tier-l); }
.ms-t-fusion_coins { --c: var(--success); }
.ms-t-autofuse { --c: #ff7ab8; }
.ms-prize { display: flex; flex-direction: column; align-items: center; gap: var(--s4); margin-top: var(--s5); }
.ms-prize-tile { width: 168px; height: 168px; flex: none; box-shadow: inset 0 0 0 2px var(--c), 0 0 46px color-mix(in srgb, var(--c) 22%, transparent); animation: ms-prize-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.ms-prize-tile span { font-size: 2.8rem; }
.ms-prize-tile strong { font-size: 1.15rem; font-weight: 500; color: var(--ink); }
@keyframes ms-prize-pop { from { opacity: 0; transform: scale(0.6); } }

@media (max-width: 640px) {
  .ms-chest-box { text-align: left; }
  .ms-score strong { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ms-chest-art, .ms-chest-glow { animation: none; }
  .ms-card:hover { transform: none; }
}
