/* =====================================================================
   GEO ARMY — MISIONES V4 (solo presentación)
   Estilos EXCLUSIVOS de misiones.html. Todo va bajo ".ms4" (clase del
   contenedor .v3-page de esa página) o con prefijo "ms-"/"ms4-", así que
   no puede afectar a ninguna otra página. No se toca style.css ni
   v3-theme.css; aquí solo se sobreescribe lo necesario dentro de .ms4.
   Paleta Geo Army V4: negro, morado, naranja y dorado. Los colores de
   estado de misión (disponible / en progreso / completada / pendiente)
   son funcionales y se conservan por --ms-ac.
   ===================================================================== */

.ms4 {
  --ms-orange: #ff7a2f;
  --ms-gold: #ffb84a;
  --ms-purple: #9147ff;
  --ms-violet: #a54af0;
  --ms-green: #3ddc84;
  --ms-ink: #f4ecff;
  --ms-mute: #b9a6d6;
  --ms-card: linear-gradient(180deg, rgba(36,20,56,.74), rgba(14,8,22,.86));
  --ms-panel: linear-gradient(165deg, rgba(30,15,48,.9), rgba(11,6,18,.94));
  background:
    radial-gradient(ellipse 70% 45% at 12% 0%, rgba(255,122,26,.16), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(151,71,255,.18), transparent 60%),
    linear-gradient(180deg, #0a0612 0%, #120a1f 42%, #190e14 100%);
  color: var(--ms-ink);
}
.ms4 *, .ms4 *::before, .ms4 *::after { box-sizing: border-box; }

/* CORRECCIÓN [hidden] — SOLO en esta página. style.css/v3-theme.css no
   definen una regla global, y las clases con "display:" ganan al atributo
   hidden del navegador (por eso un visitante sin sesión veía "— XP / 0").
   Acotada a .ms4 para no cambiar nada fuera de Misiones. */
.ms4 [hidden] { display: none !important; }

.ms4 .ms4-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Fondo / Halloween (decoración detrás del contenido) ---------- */
.ms4 .v3-stars { opacity: .5; filter: hue-rotate(15deg) saturate(1.2); }
.ms4 .v3-nebula { opacity: .5; filter: hue-rotate(20deg); }
.ms4 .v3-nav {
  background: linear-gradient(180deg, rgba(20,10,26,.92), rgba(12,7,16,.88));
  border-bottom: 1px solid rgba(255,122,26,.28);
}
.ms4 .v3-wordmark { color: #ffb347; text-shadow: 0 0 10px rgba(255,140,0,.55); }
.ms4 .v3-page-links a {
  color: #e7d7ff; padding: 7px 12px; border-radius: 10px;
  transition: color .25s, background .25s;
}
.ms4 .v3-page-links a:hover { color: #ffb347; background: rgba(255,122,47,.1); }
.ms4 .v3-page-links a:focus-visible,
.ms4 .ms-ranking-link:focus-visible,
.ms4 .ms-claim-btn:focus-visible,
.ms4 .ms-login-btn:focus-visible { outline: 2px solid var(--ms-gold); outline-offset: 2px; }

.ms4 .mg-hw-decor { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.ms4 .mg-hw-decor span { position: absolute; opacity: .4; filter: drop-shadow(0 0 6px rgba(255,140,0,.35)); }
.ms4 .mg-hw-decor .mg-hw-bat { font-size: 20px; animation: mgHwFly 22s linear infinite; }
.ms4 .mg-hw-decor .mg-hw-bat2 { font-size: 15px; animation: mgHwFly 28s linear infinite reverse; opacity: .3; }
.ms4 .mg-hw-decor .mg-hw-pumpkin { font-size: 24px; opacity: .35; animation: mgHwBob 7s ease-in-out infinite; }
.ms4 .mg-hw-decor .mg-hw-ghost { font-size: 19px; opacity: .28; animation: mgHwBob 9s ease-in-out infinite; }
.ms4 .mg-hw-decor .mg-hw-web { font-size: 32px; opacity: .24; }
@keyframes mgHwFly {
  0% { transform: translate(-10vw, 10vh) rotate(0deg); }
  50% { transform: translate(55vw, 4vh) rotate(6deg); }
  100% { transform: translate(110vw, 14vh) rotate(-4deg); }
}
@keyframes mgHwBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Todo el contenido por encima de la decoración */
.ms4 .ms-hero, .ms4 .ms-wrap { position: relative; z-index: 2; }

/* ---------- HERO ---------- */
.ms4 .ms-hero { isolation: isolate; overflow: hidden; padding: 30px 1.5rem 34px; text-align: left; border-bottom: 1px solid rgba(255,184,74,.14); }
.ms4 .ms-hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 150%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(34% 42% at 18% 30%, rgba(255,122,47,.16), transparent 65%),
    radial-gradient(34% 42% at 82% 24%, rgba(145,71,255,.2), transparent 65%);
  filter: blur(18px);
}
.ms4 .ms-hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ms4 .ms-hero-grid {
  position: absolute; inset: -10%;
  background-image:
    linear-gradient(rgba(190,150,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190,150,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(60% 70% at 30% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(60% 70% at 30% 30%, #000 0%, transparent 78%);
}
/* Planeta y horizonte: solo CSS (no hay arte nuevo) */
.ms4 .ms4-planet {
  position: absolute; left: -180px; bottom: -920px; width: 1000px; height: 1000px; border-radius: 50%;
  background: radial-gradient(circle at 50% 8%, rgba(255,150,60,.38), rgba(145,71,255,.22) 34%, rgba(10,6,18,0) 62%);
  box-shadow: inset 0 22px 46px -18px rgba(255,184,74,.5);
}
.ms4 .ms4-planet-2 {
  position: absolute; right: -9%; top: -34%; width: 28%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(190,120,255,.34), rgba(80,30,140,.18) 46%, transparent 70%);
}

.ms4 .ms4-hero-inner {
  position: relative; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 30px; align-items: center;
}
.ms4 .ms4-hero-copy { position: relative; min-width: 0; }

/* Medallón con el emblema (recurso existente logo-halloween.png) */
.ms4 .ms4-title-row { display: flex; align-items: center; gap: 18px; flex-wrap: nowrap; margin-bottom: 12px; }
.ms4 .ms4-title-row .ms-title { margin: 0; min-width: 0; }
.ms4 .ms4-emblem {
  flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: none;
  box-shadow: 0 0 0 2px rgba(255,184,74,.5), 0 0 24px rgba(255,122,47,.45), 0 0 38px rgba(145,71,255,.35);
}
@media (min-width: 760px) { .ms4 .ms4-emblem { display: block; } }

.ms4 .ms-eyebrow {
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: .32em;
  text-transform: uppercase; color: #ff9d3d; text-shadow: 0 0 16px rgba(255,140,0,.4); margin-bottom: 8px;
}
.ms4 .ms-title {
  font-family: 'Orbitron', sans-serif; font-weight: 900; letter-spacing: .02em; line-height: 1;
  font-size: clamp(2.3rem, 8.4vw, 4.6rem); margin: 0 0 12px; text-transform: uppercase;
  background: linear-gradient(95deg, #fff 0%, #ffe3b3 30%, #ffb347 55%, #b784ff 88%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(255,140,40,.26));
}
.ms4 .ms-sub { text-wrap: balance; font-size: 15.5px; color: #e0d2f5; max-width: 470px; margin: 0 0 20px; line-height: 1.55; font-weight: 500; }

.ms4 .ms4-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.ms4 .ms4-perks li { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ms4 .ms4-perks svg { width: 28px; height: 28px; flex: 0 0 auto; color: var(--ms-gold); filter: drop-shadow(0 0 8px rgba(255,184,74,.45)); }
.ms4 .ms4-perks strong { display: block; font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.2; }
.ms4 .ms4-perks span { display: block; font-size: 11.5px; color: var(--ms-mute); line-height: 1.25; }

/* ---------- PANEL DE RANGO (msHeroStats) ---------- */
/* Solo se muestra cuando my_rank_summary() respondio (loadRankHero marca data-rank-ready). */
.ms4 .ms4-panel:not([data-rank-ready]) { display: none !important; }
.ms4 .ms4-panel {
  position: relative; padding: 18px 20px 14px; border-radius: 20px;
  background: var(--ms-panel);
  border: 1px solid rgba(255,184,74,.42);
  box-shadow: 0 0 0 1px rgba(145,71,255,.2), 0 18px 46px -18px rgba(0,0,0,.7), 0 0 36px -8px rgba(255,122,47,.28);
  display: block; max-width: none; margin: 0; text-align: left;
}
.ms4 .ms4-rank-row { display: flex; align-items: center; gap: 16px; }
.ms4 .ms4-badge-wrap { flex: 0 0 auto; width: 124px; min-height: 100px; display: flex; align-items: center; justify-content: center; }
.ms4 .ms4-rank-badge {
  width: 124px; height: 124px; object-fit: contain; margin: 0; flex-shrink: 0;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.65)) drop-shadow(0 0 16px rgba(255,184,74,.38));
}
.ms4 .ms4-rank-main { flex: 1 1 auto; min-width: 0; }
.ms4 .ms4-kicker { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #cdb8ee; }
.ms4 .ms4-rank-name {
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(1.45rem, 4.4vw, 2.1rem); line-height: 1.1;
  margin: 2px 0 8px; text-transform: uppercase; color: var(--ms-gold); text-shadow: 0 0 18px rgba(255,184,74,.35); overflow-wrap: anywhere;
}
.ms4 .ms4-progress { padding: 0; position: static; }
.ms4 .ms-progress-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px 12px; margin: 0 0 7px; flex-wrap: wrap; }
.ms4 #msProgressText { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: clamp(.95rem, 3.4vw, 1.2rem); color: #fff; white-space: nowrap; }
.ms4 .ms4-next { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ms-mute); text-align: right; }
.ms4 .ms4-next small { font-size: 11px; line-height: 1.2; }
.ms4 .ms4-next strong { font-family: 'Orbitron', sans-serif; font-size: 12px; letter-spacing: .04em; color: var(--ms-gold); text-transform: uppercase; display: block; }
.ms4 .ms4-next img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255,184,74,.4)); }

.ms4 .ms-bar-bg { position: relative; flex: 1 1 auto; min-width: 0; height: 18px; border-radius: 100px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,184,74,.28); overflow: hidden; }
.ms4 .ms-bar-fill, .ms4 .v3-xp-bar-fill {
  background: linear-gradient(90deg, #ffb84a, #ff7a2f 62%, #a54af0);
  box-shadow: 0 0 12px rgba(255,140,40,.5);
}
/* El brillo es una capa que se desliza SOBRE un degradado fijo: no hay degradado repetido, asi que no hay corte de color. */
.ms4 .ms-bar-fill { position: relative; overflow: hidden; }
.ms4 .ms-bar-fill::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 38%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.34), transparent);
  animation: msBarSweep 3.2s ease-in-out infinite;
}
@keyframes msBarSweep { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(330%); } }
.ms4 .ms4-bar-row { display: flex; align-items: center; gap: 10px; }
.ms4 .ms4-bar-pct {
  flex: 0 0 auto; min-width: 52px; text-align: right; font-family: 'Orbitron', sans-serif;
  font-weight: 700; font-size: 13px; letter-spacing: .03em; color: #fff;
}
.ms4 .ms-max-block { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 15px; color: var(--ms-gold); text-shadow: 0 0 16px rgba(255,184,74,.5); padding: 6px 0; }

.ms4 .ms4-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.ms4 .ms4-tile {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 11px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,184,74,.2);
}
.ms4 .ms4-tile svg { width: 26px; height: 26px; flex: 0 0 auto; color: var(--ms-gold); }
.ms4 .ms4-tile strong { display: block; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 15px; color: #fff; line-height: 1.15; overflow-wrap: anywhere; }
.ms4 .ms4-tile span { display: block; font-size: 11px; color: var(--ms-mute); line-height: 1.25; }
.ms4 .ms-stat-num { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 15px; color: #fff; text-shadow: none; line-height: 1.15; }

.ms4 .ms4-weekly { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 7px 11px; border-radius: 10px; background: rgba(145,71,255,.1); border: 1px solid rgba(145,71,255,.28); clip-path: none; flex: none; min-width: 0; }
.ms4 .ms4-weekly .ms-stat-label { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 11.5px; letter-spacing: 0; text-transform: none; color: var(--ms-mute); }
.ms4 .ms4-weekly .ms-stat-value { font-family: 'Orbitron', sans-serif; font-size: 12.5px; font-weight: 700; color: #cba8ff; margin: 0; }

.ms4 .ms-ranking-link { display: inline-flex; align-items: center; min-height: 44px; margin: 2px 0 -6px; padding: 0 6px 0 2px; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 12px; color: #ffb347; }
.ms4 .ms-ranking-link:hover { color: #ffe0a8; }

/* ---------- CONTENEDOR / REJILLA ---------- */
.ms4 .ms-wrap { max-width: 1240px; margin: 0 auto; padding: 26px 20px 70px; }
.ms4 .ms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.ms4 .ms-grid > .ms-state, .ms4 .ms-grid > .ms-group[data-group="special"] { grid-column: 1 / -1; }

.ms4 .ms-state { padding: 38px 16px; text-align: center; color: #cdbfe6; border: 1px dashed rgba(255,184,74,.28); border-radius: 18px; background: rgba(20,10,30,.5); }
.ms4 .ms-login-btn {
  display: inline-block; margin-top: 14px; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 12.5px; letter-spacing: .04em;
  color: #fff; background: linear-gradient(135deg, #ff7a2f, #a54af0); padding: 12px 24px; border-radius: 12px; border: none; cursor: pointer; min-height: 44px;
  box-shadow: 0 10px 24px -10px rgba(255,122,47,.6);
}

/* ---------- GRUPOS ---------- */
.ms4 .ms-group {
  --grp: #ffb84a; position: relative; min-width: 0; padding: 16px 16px 16px; border-radius: 18px;
  background: var(--ms-panel); border: 1px solid color-mix(in srgb, var(--grp) 40%, transparent);
  box-shadow: 0 16px 36px -22px color-mix(in srgb, var(--grp) 55%, transparent);
  display: flex; flex-direction: column;
}
.ms4 .ms-group[data-group="daily"] { --grp: #ffb84a; }
.ms4 .ms-group[data-group="weekly"] { --grp: #a54af0; }
.ms4 .ms-group[data-group="community"] { --grp: #ff7a2f; }
.ms4 .ms-group[data-group="twitch"] { --grp: #9147ff; }
.ms4 .ms-group[data-group="special"] { --grp: #ffb84a; }

.ms4 .ms-group-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; text-transform: none; letter-spacing: 0; }
.ms4 .ms-group-ic { flex: 0 0 auto; width: 38px; height: 38px; color: var(--grp); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--grp) 55%, transparent)); }
.ms4 .ms-group-ic svg { width: 100%; height: 100%; display: block; }
.ms4 .ms4-group-titles { min-width: 0; flex: 1 1 auto; }
.ms4 .ms4-group-title { margin: 0; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.ms4 .ms4-group-sub { text-wrap: pretty; margin: 2px 0 0; font-size: 12.5px; color: var(--ms-mute); line-height: 1.35; }
.ms4 .ms-group-count {
  margin-left: auto; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 11px; color: var(--grp);
  background: color-mix(in srgb, var(--grp) 12%, transparent); border: 1px solid color-mix(in srgb, var(--grp) 35%, transparent);
  border-radius: 100px; padding: 2px 10px; flex: 0 0 auto;
}
.ms4 .ms-group-grid { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); gap: 12px; align-items: stretch; }

/* ---------- TARJETA DE MISIÓN ---------- */
.ms4 .ms-card {
  --ms-ac: #ffb84a;
  position: relative; display: flex; gap: 12px; align-items: stretch; min-width: 0; overflow: hidden;
  background: var(--ms-card); border: 1px solid color-mix(in srgb, var(--ms-ac) 30%, rgba(255,255,255,.08));
  border-radius: 14px; clip-path: none; padding: 14px 14px 14px;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.ms4 .ms-card::before, .ms4 .ms-card::after { content: ""; position: absolute; top: 0; left: 0; background: var(--ms-ac); }
.ms4 .ms-card::before { width: 26px; height: 2px; }
.ms4 .ms-card::after { width: 2px; height: 26px; }
.ms4 .ms-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ms-ac) 60%, transparent); }

.ms4 .ms-icon {
  flex: 0 0 auto; align-self: flex-start; width: 48px; height: 48px; border-radius: 50%; font-size: 0; color: var(--ms-ac);
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.1), rgba(8,4,14,.92));
  border: 1.5px solid var(--ms-ac); box-shadow: 0 0 16px -2px var(--ms-ac), inset 0 0 12px -4px var(--ms-ac);
}
.ms4 .ms-icon svg { width: 25px; height: 25px; display: block; }
.ms4 .ms-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ms4 .ms-top-row { display: flex; flex-wrap: nowrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-bottom: 3px; }
.ms4 .ms-name { flex: 1 1 auto; min-width: 0; text-wrap: balance; margin: 0; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; color: #fff; line-height: 1.25; }
.ms4 .ms-reward { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 12.5px; color: var(--ms-gold); white-space: nowrap; text-shadow: 0 0 10px rgba(255,184,74,.35); }
.ms4 .ms-desc { text-wrap: pretty; font-size: 12.5px; color: #cbbfe0; margin: 0 0 10px; line-height: 1.5; }
.ms4 .ms-progress { margin: 0 0 10px; margin-top: auto; padding-top: 2px; }
.ms4 .ms-progress-mini-row { display: flex; justify-content: space-between; font-size: 11.5px; color: #d9cdee; margin-bottom: 6px; font-family: 'Orbitron', sans-serif; font-weight: 500; }
.ms4 .ms-card .v3-xp-bar-bg { height: 8px; background: rgba(255,255,255,.09); }
.ms4 .ms-card[data-state="available"] .v3-xp-bar-fill { background: linear-gradient(90deg, #ffb84a, #ff7a2f); }
.ms4 .ms-card[data-state="progress"] .v3-xp-bar-fill { background: linear-gradient(90deg, #ff7a2f, #a54af0); }
.ms4 .ms-card[data-state="done"] .v3-xp-bar-fill { background: linear-gradient(90deg, #2fbf74, #3ddc84); box-shadow: 0 0 10px rgba(61,220,132,.5); }
.ms4 .ms-card[data-state="soon"] .v3-xp-bar-fill { background: #7a8296; box-shadow: none; }

/* Franja de estado (informativa, NO es un botón: sin hover ni cursor) */
.ms4 .ms4-status {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 12px;
  border-radius: 10px; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; text-align: center;
  color: var(--ms-ac); background: color-mix(in srgb, var(--ms-ac) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--ms-ac) 38%, transparent); cursor: default; user-select: none;
}
.ms4 .ms4-status svg { width: 15px; height: 15px; flex: 0 0 auto; }
.ms4 .ms4-status span { text-wrap: balance; line-height: 1.25; }
.ms4 .ms-card[data-state="available"] .ms4-status { color: #ffc766; }
.ms4 .ms-card[data-state="progress"] .ms4-status { color: #dcc0ff; }
.ms4 .ms-card[data-state="soon"] .ms4-status { color: #ddd5ee; background: rgba(255,255,255,.05); border-color: rgba(190,180,215,.34); }
.ms4 .ms-card[data-state="done"] .ms4-status { color: #d8ffe9; background: color-mix(in srgb, var(--ms-green) 16%, transparent); border-color: color-mix(in srgb, var(--ms-green) 55%, transparent); box-shadow: 0 0 16px -6px var(--ms-green); }

/* Estados */
.ms4 .ms-card[data-state="available"] { --ms-ac: #ffb84a; }
.ms4 .ms-card[data-state="progress"] { --ms-ac: #a54af0; border-color: rgba(165,74,240,.4); box-shadow: 0 18px 38px -28px rgba(165,74,240,.6); }
.ms4 .ms-card[data-state="done"] {
  --ms-ac: #3ddc84; border-color: rgba(61,220,132,.42);
  background: linear-gradient(180deg, rgba(61,220,132,.09), rgba(14,8,22,.86));
  box-shadow: 0 18px 38px -26px rgba(61,220,132,.45);
}
.ms4 .ms-card[data-state="done"] .ms-name { color: #eafff4; }
.ms4 .ms-card[data-state="soon"] { --ms-ac: #a79fbd; box-shadow: none; }
.ms4 .ms-card[data-state="soon"]:hover { transform: none; }
.ms4 .ms-card[data-state="soon"] .ms-icon { box-shadow: none; }

/* Claim REAL de STREAM_RETWEET (botón verdadero: relleno sólido + flecha) */
.ms4 .ms-claim-wrap { margin-top: auto; padding-top: 2px; }
.ms4 .ms-claim-btn {
  position: relative; width: 100%; min-height: 44px; border-radius: 11px; border: 1px solid rgba(255,184,74,.7);
  background: linear-gradient(135deg, #c2410c, #7c3aed); color: #fff; font-family: 'Orbitron', sans-serif; font-weight: 700;
  font-size: 12.5px; letter-spacing: .08em; text-shadow: 0 1px 2px rgba(0,0,0,.45); text-transform: uppercase; cursor: pointer; padding: 0 16px;
  box-shadow: 0 10px 22px -10px rgba(255,122,47,.7), inset 0 0 0 1px rgba(255,184,74,.25);
  transition: box-shadow .2s ease, transform .2s ease;
}
.ms4 .ms-claim-btn:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--ms-gold), 0 12px 24px -10px rgba(255,122,47,.8); transform: translateY(-1px); }
.ms4 .ms-claim-btn:disabled { cursor: default; box-shadow: none; text-shadow: none; color: #e9defa; background: rgba(255,255,255,.07); border-color: rgba(255,184,74,.38); }

.ms4 .ms-claim-notice {
  max-width: none; margin: 0 0 16px; padding: 12px 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(14,8,22,.92); color: #e2d8f2; font-size: 13px; line-height: 1.45;
}
.ms4 .ms-claim-notice[data-kind="success"] { border-color: rgba(61,220,132,.45); color: #bff6d5; }
.ms4 .ms-claim-notice[data-kind="warning"] { border-color: rgba(255,184,74,.45); color: #ffe3a6; }
.ms4 .ms-claim-notice[data-kind="error"] { border-color: rgba(255,105,120,.45); color: #ffc2c9; }

/* ---------- MISIONES COMPLETADAS ---------- */
.ms4 .ms4-completed {
  margin-top: 18px; padding: 16px; border-radius: 18px; background: var(--ms-panel);
  border: 1px solid rgba(61,220,132,.4); box-shadow: 0 16px 36px -22px rgba(61,220,132,.5);
}
.ms4 .ms4-completed .ms-group-ic { color: var(--ms-green); filter: drop-shadow(0 0 8px rgba(61,220,132,.5)); }
.ms4 .ms4-completed .ms-group-count { color: var(--ms-green); background: rgba(61,220,132,.1); border-color: rgba(61,220,132,.38); }
.ms4 .ms4-done-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.ms4 .ms4-done-row {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 11px 13px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(61,220,132,.09), rgba(14,8,22,.7)); border: 1px solid rgba(61,220,132,.32);
}
.ms4 .ms4-done-row .ms-icon { width: 44px; height: 44px; --ms-ac: #3ddc84; }
.ms4 .ms4-done-info { flex: 1 1 auto; min-width: 0; }
.ms4 .ms4-done-info strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 14.5px; color: #eafff4; line-height: 1.25; }
.ms4 .ms4-done-info span { display: block; font-size: 12px; color: #b8ccc0; line-height: 1.4; }
.ms4 .ms4-done-side { flex: 0 0 auto; text-align: right; display: flex; align-items: center; gap: 10px; }
.ms4 .ms4-done-side b { display: block; font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 13px; color: var(--ms-gold); }
.ms4 .ms4-done-side em { display: block; font-style: normal; font-size: 11.5px; color: #b8ccc0; }
.ms4 .ms4-done-check { width: 26px; height: 26px; flex: 0 0 auto; color: var(--ms-green); filter: drop-shadow(0 0 6px rgba(61,220,132,.5)); }
.ms4 .ms4-done-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: #b8ccc0; border: 1px dashed rgba(61,220,132,.3); border-radius: 12px; grid-column: 1 / -1; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .ms4 .ms4-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .ms4 .ms4-panel { max-width: 640px; }
}
@media (max-width: 900px) {
  .ms4 .ms-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .ms4 .ms4-planet { left: -240px; bottom: -640px; width: 700px; height: 700px; }
  .ms4 .ms-hero { padding: 20px 1.1rem 24px; }
  .ms4 .ms-sub { font-size: 14px; margin-bottom: 14px; }
  .ms4 .ms4-perks { gap: 8px 14px; }
  .ms4 .ms4-perks svg { width: 24px; height: 24px; }
  .ms4 .ms-wrap { padding: 18px 14px 56px; }
  .ms4 .mg-hw-decor .mg-hw-pumpkin, .ms4 .mg-hw-decor .mg-hw-ghost, .ms4 .mg-hw-decor .mg-hw-web { display: none; }
}
@media (max-width: 520px) {
  /* Panel de rango compacto: insignia + nombre en una fila; XP/barra a todo el ancho */
  .ms4 .ms4-panel { padding: 12px 12px 6px; border-radius: 16px; }
  .ms4 .ms4-rank-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; row-gap: 0; align-items: center; }
  .ms4 .ms4-rank-main { display: contents; }
  .ms4 .ms4-badge-wrap { grid-column: 1; grid-row: 1 / span 2; width: 64px; min-height: 0; }
  .ms4 .ms4-rank-badge { width: 64px; height: 64px; }
  .ms4 .ms4-kicker { grid-column: 2; grid-row: 1; align-self: end; }
  .ms4 .ms4-rank-name { grid-column: 2; grid-row: 2; align-self: start; margin: 0; font-size: 1.35rem; }
  .ms4 .ms4-progress { grid-column: 1 / -1; grid-row: 3; margin-top: 10px; }
  .ms4 .ms-progress-row { margin-bottom: 6px; }
  .ms4 .ms4-next { margin-left: 0; text-align: left; }
  .ms4 .ms4-next img { width: 30px; height: 30px; }
  .ms4 .ms4-tiles { gap: 6px; margin-top: 10px; }
  .ms4 .ms4-tile { flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 2px; padding: 8px 4px; }
  .ms4 .ms4-tile svg { display: none; }
  .ms4 .ms4-tile > div { text-align: center; }
  .ms4 .ms4-tile strong, .ms4 .ms-stat-num { font-size: 14px; }
  .ms4 .ms4-tile span { font-size: 10.5px; }
  .ms4 .ms4-weekly { margin-top: 8px; padding: 5px 10px; }
  .ms4 .ms-group { padding: 13px 12px; }
  .ms4 .ms4-done-row { flex-wrap: wrap; row-gap: 8px; }
  .ms4 .ms4-done-info { flex: 1 1 0; }
  .ms4 .ms4-done-side { flex: 0 0 100%; padding-left: 56px; text-align: left; justify-content: space-between; }
}
@media (max-width: 480px) {
  /* Tarjetas: icono + titulo/XP arriba; descripcion, progreso y estado a todo el ancho */
  .ms4 .ms-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 12px 11px; }
  .ms4 .ms-body { display: contents; }
  .ms4 .ms-icon { grid-column: 1; grid-row: 1; width: 42px; height: 42px; }
  .ms4 .ms-icon svg { width: 22px; height: 22px; }
  .ms4 .ms-top-row { grid-column: 2; grid-row: 1; align-self: center; margin: 0; flex-wrap: wrap; }
  .ms4 .ms-desc, .ms4 .ms-progress, .ms4 .ms-claim-wrap, .ms4 .ms4-status { grid-column: 1 / -1; }
  .ms4 .ms-desc { margin: 10px 0 10px; }
  .ms4 .ms-progress { margin: 0 0 10px; }
  .ms4 .ms-claim-wrap, .ms4 .ms4-status { margin-top: 0; }
}
@media (max-width: 380px) {
  .ms4 .ms-group-count { display: none; }
}

/* ---------- MOVIMIENTO REDUCIDO ---------- */
@media (prefers-reduced-motion: reduce) {
  .ms4 .ms-bar-fill::after { animation: none; display: none; }
  .ms4 .mg-hw-decor span { animation: none !important; }
  .ms4 .ms-card, .ms4 .ms-claim-btn { transition: none; }
  .ms4 .ms-card:hover, .ms4 .ms-claim-btn:hover:not(:disabled) { transform: none; }
  .ms4 .v3-xp-bar-fill { transition: none; }
}
