.mmp-shell,
.mmp-shell * {
  box-sizing: border-box;
}

.mmp-shell {
  --mmp-bg: #070914;
  --mmp-panel: rgba(10, 14, 28, 0.94);
  --mmp-panel-2: rgba(18, 24, 45, 0.86);
  --mmp-gold: #d8b66a;
  --mmp-ivory: #f4efe3;
  --mmp-muted: #9ca7bc;
  --mmp-cyan: #59e2ff;
  --mmp-magenta: #d76dff;
  --mmp-red: #ff6b7a;
  --mmp-green: #75f0b0;
  color: var(--mmp-ivory);
  width: 100%;
  max-width: 1120px;
  margin: 32px auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mmp-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(280px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.mmp-card {
  position: relative;
  min-height: 560px;
  border: 1px solid rgba(216, 182, 106, 0.45);
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(89, 226, 255, 0.18), transparent 14%),
    radial-gradient(circle at 20% 18%, rgba(215, 109, 255, 0.2), transparent 20%),
    linear-gradient(145deg, #070914 0%, #101529 42%, #04050c 100%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.52), inset 0 0 0 1px rgba(255,255,255,0.05);
  isolation: isolate;
}

.mmp-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(216, 182, 106, 0.26);
  border-radius: 20px;
  pointer-events: none;
  z-index: 4;
}

.mmp-card::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: conic-gradient(from 90deg, transparent, rgba(89, 226, 255, 0.12), transparent, rgba(215, 109, 255, 0.12), transparent);
  opacity: 0.45;
  animation: mmp-rotate 16s linear infinite;
  z-index: 0;
}

.mmp-card__aura,
.mmp-card__static,
.mmp-card__particles,
.mmp-card__entity,
.mmp-card__topline,
.mmp-card__caption,
.mmp-card__footer {
  position: absolute;
  z-index: 2;
}

.mmp-card__aura {
  inset: 70px 40px 96px;
  border-radius: 48% 52% 46% 54%;
  background:
    radial-gradient(circle, rgba(244, 239, 227, 0.2), transparent 9%),
    radial-gradient(circle at 46% 45%, rgba(89, 226, 255, 0.45), transparent 24%),
    radial-gradient(circle at 58% 54%, rgba(215, 109, 255, 0.38), transparent 32%);
  filter: blur(2px);
  opacity: 0.7;
  animation: mmp-breathe 3.8s ease-in-out infinite;
}

.mmp-card__static {
  inset: 0;
  z-index: 3;
  opacity: 0.13;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 7px);
  animation: mmp-static 1.4s steps(2, end) infinite;
  mix-blend-mode: screen;
}

.mmp-card__topline {
  top: 28px;
  left: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.mmp-card__number,
.mmp-card__status {
  padding: 7px 11px;
  border: 1px solid rgba(216, 182, 106, 0.28);
  border-radius: 999px;
  background: rgba(4, 5, 12, 0.55);
  color: var(--mmp-gold);
}

.mmp-card__entity {
  inset: 110px 48px 150px;
  display: grid;
  place-items: center;
  z-index: 5;
}

.mmp-card__sigil {
  width: min(210px, 52vw);
  aspect-ratio: 1;
  border-radius: 46% 54% 44% 56%;
  border: 2px solid rgba(244, 239, 227, 0.24);
  background:
    radial-gradient(circle at 50% 42%, rgba(244, 239, 227, 0.75) 0 2%, transparent 3%),
    radial-gradient(circle, rgba(89, 226, 255, 0.42), transparent 35%),
    linear-gradient(145deg, rgba(215, 109, 255, 0.2), rgba(4, 5, 12, 0.2));
  clip-path: polygon(50% 0%, 69% 23%, 98% 36%, 75% 57%, 79% 91%, 50% 75%, 21% 91%, 25% 57%, 2% 36%, 31% 23%);
  box-shadow: 0 0 38px rgba(89, 226, 255, 0.3), inset 0 0 32px rgba(215, 109, 255, 0.24);
  animation: mmp-float 4.8s ease-in-out infinite;
}

.mmp-card__eyes {
  position: absolute;
  top: 43%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 32px;
  opacity: 0;
  transition: opacity 280ms ease;
}

.mmp-card__eyes span {
  width: 14px;
  height: 22px;
  border-radius: 999px;
  background: var(--mmp-ivory);
  box-shadow: 0 0 16px var(--mmp-cyan);
  animation: mmp-blink 5s ease-in-out infinite;
}

.mmp-card__caption {
  left: 28px;
  right: 28px;
  bottom: 64px;
  z-index: 5;
  padding: 18px;
  border: 1px solid rgba(216, 182, 106, 0.24);
  border-radius: 18px;
  background: rgba(4, 5, 12, 0.68);
}

.mmp-card__name {
  margin: 0 0 8px;
  color: var(--mmp-ivory);
  font-size: clamp(22px, 4vw, 31px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.mmp-card__line {
  margin: 0;
  color: var(--mmp-muted);
  font-size: 14px;
}

.mmp-card__footer {
  left: 28px;
  right: 28px;
  bottom: 26px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  color: var(--mmp-gold);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mmp-card__particles {
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.mmp-card__particles span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: var(--mmp-cyan);
  opacity: 0.7;
  box-shadow: 0 0 14px var(--mmp-cyan);
  animation: mmp-particle 6s linear infinite;
}

.mmp-card__particles span:nth-child(1) { left: 20%; top: 80%; animation-delay: 0s; }
.mmp-card__particles span:nth-child(2) { left: 44%; top: 75%; animation-delay: -1.6s; }
.mmp-card__particles span:nth-child(3) { left: 68%; top: 82%; animation-delay: -3s; }
.mmp-card__particles span:nth-child(4) { left: 78%; top: 62%; animation-delay: -4.5s; }
.mmp-card__particles span:nth-child(5) { left: 32%; top: 60%; animation-delay: -2.4s; }

.mmp-card--listening .mmp-card__eyes,
.mmp-card--awakening .mmp-card__eyes,
.mmp-card--revealed .mmp-card__eyes {
  opacity: 1;
}

.mmp-card--awakening .mmp-card__sigil {
  box-shadow: 0 0 48px rgba(215, 109, 255, 0.42), inset 0 0 38px rgba(89, 226, 255, 0.26);
  animation-duration: 3.2s;
}

.mmp-card--revealed {
  border-color: rgba(244, 239, 227, 0.55);
}

.mmp-card--revealed .mmp-card__sigil {
  border-color: rgba(244, 239, 227, 0.48);
  background:
    radial-gradient(circle at 50% 42%, rgba(244, 239, 227, 0.92) 0 5%, transparent 6%),
    radial-gradient(circle, rgba(117, 240, 176, 0.42), transparent 30%),
    radial-gradient(circle at 60% 60%, rgba(89, 226, 255, 0.44), transparent 42%);
  clip-path: polygon(50% 0%, 61% 30%, 93% 21%, 72% 50%, 93% 79%, 61% 70%, 50% 100%, 39% 70%, 7% 79%, 28% 50%, 7% 21%, 39% 30%);
}

.mmp-panel {
  border: 1px solid rgba(216, 182, 106, 0.22);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--mmp-panel), rgba(6, 8, 18, 0.95));
  padding: clamp(20px, 3vw, 28px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
}

.mmp-kicker {
  margin: 0 0 8px;
  color: var(--mmp-gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.mmp-panel h2 {
  margin: 0 0 10px;
  color: var(--mmp-ivory);
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.mmp-panel p {
  color: var(--mmp-muted);
}

.mmp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 12px;
}

.mmp-stat,
.mmp-mood,
.mmp-dialogue,
.mmp-memory {
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--mmp-panel-2);
  border-radius: 16px;
}

.mmp-stat {
  min-height: 82px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mmp-stat span,
.mmp-mood span {
  color: var(--mmp-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mmp-stat strong {
  color: var(--mmp-ivory);
  font-size: 28px;
  line-height: 1;
}

.mmp-mood {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.mmp-mood strong {
  color: var(--mmp-gold);
}

.mmp-dialogue {
  min-height: 104px;
  padding: 18px;
  margin: 14px 0;
}

.mmp-dialogue p {
  margin: 0;
  color: var(--mmp-ivory);
  font-size: 17px;
  line-height: 1.5;
}

.mmp-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.mmp-actions button,
.mmp-reset {
  appearance: none;
  border: 1px solid rgba(216, 182, 106, 0.24);
  border-radius: 14px;
  background: rgba(4, 5, 12, 0.5);
  color: var(--mmp-ivory);
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mmp-actions button:hover,
.mmp-reset:hover,
.mmp-actions button:focus-visible,
.mmp-reset:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(216, 182, 106, 0.7);
  background: rgba(216, 182, 106, 0.11);
  outline: none;
}

.mmp-actions .mmp-primary {
  background: linear-gradient(135deg, rgba(216, 182, 106, 0.24), rgba(89, 226, 255, 0.14));
}

.mmp-memory {
  padding: 12px 16px;
}

.mmp-memory summary {
  cursor: pointer;
  color: var(--mmp-gold);
  font-weight: 800;
}

.mmp-memory ol {
  margin: 12px 0 0 20px;
  padding: 0;
  color: var(--mmp-muted);
  line-height: 1.5;
}

.mmp-reset {
  width: 100%;
  margin-top: 14px;
  color: #ffb8c0;
  border-color: rgba(255, 107, 122, 0.26);
}

@keyframes mmp-rotate {
  to { transform: rotate(360deg); }
}

@keyframes mmp-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.58; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

@keyframes mmp-static {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -1px); }
}

@keyframes mmp-float {
  0%, 100% { transform: translateY(5px) scale(0.98) rotate(-2deg); }
  50% { transform: translateY(-9px) scale(1.03) rotate(2deg); }
}

@keyframes mmp-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

@keyframes mmp-particle {
  from { transform: translateY(0) scale(0.85); opacity: 0; }
  16% { opacity: 0.9; }
  to { transform: translateY(-360px) scale(1.2); opacity: 0; }
}

@media (max-width: 820px) {
  .mmp-layout {
    grid-template-columns: 1fr;
  }

  .mmp-card {
    min-height: 520px;
  }
}

@media (max-width: 560px) {
  .mmp-stats,
  .mmp-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mmp-card {
    min-height: 500px;
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mmp-card::after,
  .mmp-card__aura,
  .mmp-card__static,
  .mmp-card__sigil,
  .mmp-card__eyes span,
  .mmp-card__particles span {
    animation: none !important;
  }
}
