/* Feinschliff: größere Memory-Vorschau, Medaille, Rekord-Badges und flächige Sternanimation */
.memory-preview {
  width: 260px !important;
  height: 154px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  padding: 12px !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(184, 243, 74, .15), transparent 68%),
    #101410 !important;
}

.memory-preview .preview-card {
  width: 100% !important;
  height: 128px !important;
  border: 1px solid rgba(184, 243, 74, .28);
  border-radius: 12px !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .12),
    0 12px 26px rgba(0, 0, 0, .26) !important;
}

.memory-preview .preview-card svg {
  width: 82px !important;
  height: 116px !important;
}

.mission.done {
  border-color: rgba(255, 216, 74, .66) !important;
  box-shadow: 0 18px 62px rgba(255, 216, 74, .11) !important;
}

.mission.done::before {
  content: "";
  position: absolute;
  top: 50px;
  right: 27px;
  width: 42px;
  height: 36px;
  background: linear-gradient(90deg, #916200 0 43%, transparent 43% 57%, #916200 57% 100%);
  clip-path: polygon(0 0, 42% 0, 50% 100%, 58% 0, 100% 0, 78% 100%, 50% 72%, 22% 100%);
  opacity: .9;
}

.mission.done::after {
  content: "✓" !important;
  top: 15px !important;
  right: 15px !important;
  z-index: 2;
  width: 62px !important;
  height: 62px !important;
  border: 2px solid #fff2a5 !important;
  color: #513a00 !important;
  background:
    radial-gradient(circle at 35% 27%, #fffbd2 0 8%, transparent 9%),
    radial-gradient(circle at 36% 30%, #fff6ac, #ffdd54 56%, #c98d00 100%) !important;
  font-size: 1.72rem !important;
  font-weight: 950;
  box-shadow:
    0 0 38px rgba(255, 216, 74, .34),
    inset 0 2px 9px rgba(255, 255, 255, .34) !important;
  animation: academy-medal-pop .52s cubic-bezier(.2, .9, .3, 1.35) both !important;
}

@keyframes academy-medal-pop {
  from { opacity: 0; transform: scale(.22) rotate(-38deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.mission.done .topline {
  padding-right: 82px !important;
}

.record {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px !important;
  padding: 9px 13px;
  border: 1px solid rgba(184, 243, 74, .22);
  border-radius: 999px;
  color: #e6eddf !important;
  background: linear-gradient(135deg, rgba(184, 243, 74, .09), rgba(255, 216, 74, .04));
  font-size: .8rem !important;
  font-weight: 700;
}

.record::before {
  content: "★";
  color: var(--gold);
  font-size: .92rem;
}

.mission.done .record {
  border-color: rgba(255, 216, 74, .48);
  color: #fff6c8 !important;
  background: linear-gradient(135deg, rgba(255, 216, 74, .15), rgba(184, 243, 74, .08));
  animation: academy-record-pulse 2.25s ease-in-out infinite;
}

.mission.done .record::after {
  content: "Jetzt toppen!";
  margin-left: 3px;
  color: var(--green);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

@keyframes academy-record-pulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(255, 216, 74, 0);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 26px rgba(255, 216, 74, .16);
  }
}

.result {
  min-height: 150px;
  padding: 24px !important;
  background:
    radial-gradient(circle at 12% 28%, rgba(255, 216, 74, .17), transparent 30%),
    radial-gradient(circle at 86% 72%, rgba(184, 243, 74, .13), transparent 32%),
    linear-gradient(135deg, rgba(184, 243, 74, .1), rgba(184, 243, 74, .035)) !important;
}

.stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.stars::before,
.stars::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  opacity: .28;
}

.stars::before {
  width: 170px;
  height: 170px;
  left: -30px;
  top: -35px;
  background: rgba(255, 216, 74, .25);
}

.stars::after {
  width: 190px;
  height: 190px;
  right: -45px;
  bottom: -70px;
  background: rgba(184, 243, 74, .18);
}

.stars i {
  position: absolute;
  left: var(--star-x, 50%);
  top: var(--star-y, 50%);
  color: var(--gold);
  font-size: var(--star-size, 1rem);
  font-style: normal;
  line-height: 1;
  text-shadow: 0 0 16px rgba(255, 216, 74, .5);
  animation: academy-area-sparkle var(--star-duration, 1.8s) ease-in-out infinite;
  animation-delay: var(--star-delay, 0s);
}

@keyframes academy-area-sparkle {
  0%, 100% {
    opacity: .08;
    transform: scale(.35) rotate(0deg);
  }
  32% {
    opacity: 1;
    transform: scale(1.45) rotate(18deg);
  }
  64% {
    opacity: .4;
    transform: scale(.82) rotate(-14deg);
  }
}

footer {
  justify-content: flex-start !important;
}

@media (max-width: 760px) {
  .memory-preview {
    width: min(100%, 250px) !important;
    height: 144px !important;
  }

  .memory-preview .preview-card {
    height: 118px !important;
  }

  .memory-preview .preview-card svg {
    width: 76px !important;
    height: 106px !important;
  }

  .mission.done .record::after {
    display: none;
  }

  .result {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mission.done .record,
  .stars i,
  .mission.done::after {
    animation: none !important;
  }
}
