/* SCORE welcome splash (modules/score/views/score/partials/splash.ejs).
   Story in three beats, pure CSS: ideas fly in (sammeln), the gauge fills (bewerten),
   speech bubbles pop up (diskutieren). Colours only from the ZIQAVO tokens; the logo is shown
   unchanged at the bottom centre. Style attributes are blocked by the CSP, so staggering uses
   :nth-child rules. */

@property --score-splash-value {
  syntax: "<integer>";
  inherits: false;
  initial-value: 0;
}

html.score-splash-open {
  overflow: hidden;
}

.score-splash {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #effbf6;
  background: var(--ziqavo-gradient);
  font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  animation:
    score-splash-in 0.5s ease-out both,
    score-splash-out 0.6s ease-in 7.4s forwards;
}

/* The user is choosing "Nicht mehr anzeigen": stop the auto fade-out and the countdown. */
.score-splash.is-held {
  animation: none;
}

.score-splash.is-held .score-splash__progress::before {
  animation-play-state: paused;
}

.score-splash.is-leaving {
  animation: score-splash-leave 0.55s cubic-bezier(0.6, 0, 0.8, 0.2) forwards;
  pointer-events: none;
}

/* Background: drifting aurora and a perspective grid floor. */
.score-splash__aurora {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(closest-side at 30% 35%, rgb(70 245 173 / 0.22), transparent),
    radial-gradient(closest-side at 72% 60%, rgb(18 161 127 / 0.3), transparent),
    radial-gradient(closest-side at 50% 85%, rgb(10 107 107 / 0.45), transparent);
  filter: blur(40px);
  animation: score-splash-aurora 12s ease-in-out infinite alternate;
}

.score-splash__grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 75%;
  background-image:
    linear-gradient(rgb(70 245 173 / 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgb(70 245 173 / 0.28) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(600px) rotateX(58deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 0%, transparent 75%);
  animation: score-splash-grid 3s linear infinite;
}

/* Stage */
.score-splash__stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(1rem, 3vh, 1.75rem);
  padding: 0 1rem 8rem;
  text-align: center;
}

.score-splash__eyebrow {
  margin: 0;
  color: var(--ziqavo-mint);
  font:
    700 0.8rem/1 Manrope,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  animation: score-splash-tracking 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

.score-splash__title {
  display: flex;
  align-items: center;
  margin: 0;
  color: #effbf6;
  font:
    800 clamp(3.5rem, 15vw, 9.5rem) / 1 Manrope,
    "Segoe UI",
    sans-serif;
  letter-spacing: -0.03em;
}

.score-splash__letter {
  display: inline-block;
  animation: score-splash-letter 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.score-splash__letter:nth-child(1) {
  animation-delay: 0.35s;
}
.score-splash__letter:nth-child(2) {
  animation-delay: 0.45s;
}
.score-splash__letter:nth-child(4) {
  animation-delay: 0.55s;
}
.score-splash__letter:nth-child(5) {
  animation-delay: 0.65s;
}

/* The "O": a score gauge that fills up while ideas fly into it. */
.score-splash__core {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 0.86em;
  height: 0.86em;
  margin: 0 0.04em;
  animation: score-splash-pop 0.8s cubic-bezier(0.2, 1.5, 0.4, 1) 0.5s both;
}

.score-splash__gauge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
  animation: score-splash-glow 2.4s ease-in-out 3.2s infinite;
}

.score-splash__gauge-track,
.score-splash__gauge-fill {
  fill: none;
  stroke-width: 11;
}

.score-splash__gauge-track {
  stroke: rgb(239 251 246 / 0.12);
}

.score-splash__gauge-fill {
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  animation: score-splash-fill 2s cubic-bezier(0.65, 0, 0.35, 1) 1.2s forwards;
}

.score-splash__value {
  --score-splash-value: 0;
  counter-reset: score-splash var(--score-splash-value);
  font-size: 0.24em;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ziqavo-mint);
  animation: score-splash-count 2s cubic-bezier(0.65, 0, 0.35, 1) 1.2s forwards;
}

.score-splash__value::after {
  content: counter(score-splash);
}

.score-splash__orbit {
  position: absolute;
  inset: -22%;
  border: 1px dashed rgb(70 245 173 / 0.35);
  border-radius: 50%;
  animation:
    score-splash-fade 1s ease 0.9s both,
    score-splash-spin 14s linear infinite;
}

.score-splash__orbit--outer {
  inset: -48%;
  border-style: dotted;
  border-color: rgb(159 191 187 / 0.25);
  animation:
    score-splash-fade 1s ease 1.1s both,
    score-splash-spin 22s linear infinite reverse;
}

/* Beat 1 – Sammeln: four-pointed stars (the brand's accent symbol) fly into the gauge. */
.score-splash__sparks {
  position: absolute;
  inset: 50% auto auto 50%;
}

.score-splash__spark {
  --sx: 0;
  --sy: 0;
  --size: 0.12em;
  position: absolute;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  background: var(--ziqavo-mint);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  opacity: 0;
  animation: score-splash-spark 1.6s cubic-bezier(0.5, 0, 0.3, 1) both;
}

.score-splash__spark:nth-child(1) {
  --sx: -46vw;
  --sy: -38vh;
  animation-delay: 0.3s;
}
.score-splash__spark:nth-child(2) {
  --sx: 44vw;
  --sy: -34vh;
  animation-delay: 0.45s;
  --size: 0.16em;
}
.score-splash__spark:nth-child(3) {
  --sx: -40vw;
  --sy: 30vh;
  animation-delay: 0.6s;
}
.score-splash__spark:nth-child(4) {
  --sx: 48vw;
  --sy: 26vh;
  animation-delay: 0.7s;
  --size: 0.09em;
}
.score-splash__spark:nth-child(5) {
  --sx: 4vw;
  --sy: -48vh;
  animation-delay: 0.85s;
  --size: 0.15em;
}
.score-splash__spark:nth-child(6) {
  --sx: -50vw;
  --sy: -4vh;
  animation-delay: 1s;
  --size: 0.08em;
}
.score-splash__spark:nth-child(7) {
  --sx: 50vw;
  --sy: 2vh;
  animation-delay: 1.1s;
}
.score-splash__spark:nth-child(8) {
  --sx: -18vw;
  --sy: 46vh;
  animation-delay: 1.25s;
  --size: 0.14em;
}
.score-splash__spark:nth-child(9) {
  --sx: 22vw;
  --sy: 48vh;
  animation-delay: 1.4s;
  --size: 0.1em;
}
.score-splash__spark:nth-child(10) {
  --sx: -28vw;
  --sy: -46vh;
  animation-delay: 1.55s;
}

/* Beat 3 – Diskutieren: speech bubbles with typing dots pop up around the gauge. */
.score-splash__bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.score-splash__bubble {
  position: absolute;
  display: flex;
  gap: 0.035em;
  padding: 0.06em 0.09em;
  border-radius: 0.09em;
  background: #effbf6;
  font-size: 0.85em;
  box-shadow: 0 0.04em 0.12em rgb(4 22 29 / 0.5);
  opacity: 0;
  animation: score-splash-bubble 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.score-splash__bubble::after {
  content: "";
  position: absolute;
  bottom: -0.03em;
  width: 0.06em;
  height: 0.06em;
  background: inherit;
  transform: rotate(45deg);
}

.score-splash__bubble:nth-child(1) {
  top: -42%;
  left: -95%;
  transform-origin: bottom right;
  animation-delay: 2.5s;
}
.score-splash__bubble:nth-child(1)::after {
  right: 0.05em;
}
.score-splash__bubble:nth-child(2) {
  top: -52%;
  right: -80%;
  transform-origin: bottom left;
  animation-delay: 2.85s;
  background: var(--ziqavo-mint);
}
.score-splash__bubble:nth-child(2)::after {
  left: 0.05em;
}
.score-splash__bubble:nth-child(3) {
  top: 8%;
  left: 262%;
  transform-origin: bottom left;
  animation-delay: 3.2s;
}
.score-splash__bubble:nth-child(3)::after {
  left: 0.05em;
}

.score-splash__bubble i {
  width: 0.04em;
  height: 0.04em;
  border-radius: 50%;
  background: var(--ziqavo-abyss);
  animation: score-splash-typing 1s ease-in-out infinite;
}

.score-splash__bubble i:nth-child(2) {
  animation-delay: 0.15s;
}
.score-splash__bubble i:nth-child(3) {
  animation-delay: 0.3s;
}

/* Steps: light up in sync with the three beats. */
.score-splash__steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.score-splash__step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem 0.45rem 0.65rem;
  border: 1px solid rgb(159 191 187 / 0.3);
  border-radius: 999px;
  color: #9fbfbb;
  font-weight: 500;
  animation: score-splash-step 0.6s ease both;
}

.score-splash__step-icon {
  width: 0.85rem;
  height: 0.85rem;
  background: currentColor;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

.score-splash__step:nth-child(1) {
  animation-delay: 1s;
}
.score-splash__step:nth-child(2) {
  animation-delay: 1.9s;
}
.score-splash__step:nth-child(3) {
  animation-delay: 2.8s;
}

/* Call to action and auto-dismiss progress. */
.score-splash__cta {
  margin-top: 0.5rem;
  padding: 0.7rem 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--ziqavo-mint);
  color: var(--ziqavo-abyss);
  font:
    700 1rem/1 Manrope,
    "Segoe UI",
    sans-serif;
  box-shadow: 0 0 0 0 rgb(70 245 173 / 0.5);
  animation:
    score-splash-rise 0.6s cubic-bezier(0.2, 1.3, 0.4, 1) 3.5s both,
    score-splash-ping 2s ease-out 4.1s infinite;
}

.score-splash__cta:focus-visible,
.score-splash__skip:focus-visible {
  outline: 3px solid #effbf6;
  outline-offset: 3px;
}

.score-splash__progress {
  width: min(16rem, 60vw);
  height: 3px;
  border-radius: 3px;
  background: rgb(239 251 246 / 0.12);
  overflow: hidden;
  animation: score-splash-fade 0.4s ease 3.6s both;
}

.score-splash__progress::before {
  content: "";
  display: block;
  height: 100%;
  background: var(--ziqavo-accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  animation: score-splash-progress 3.8s linear 3.6s forwards;
}

.score-splash__skip {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgb(159 191 187 / 0.35);
  border-radius: 999px;
  background: transparent;
  color: #9fbfbb;
  font-size: 0.85rem;
  animation: score-splash-fade 0.6s ease 0.8s both;
}

.score-splash__skip:hover {
  color: #effbf6;
  border-color: #effbf6;
}

/* Opt-out: "Nicht mehr anzeigen" (stored as user preference score.splash.hidden). */
.score-splash__opt-out {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #9fbfbb;
  font-size: 0.875rem;
  cursor: pointer;
  animation: score-splash-fade 0.6s ease 3.8s both;
}

.score-splash__opt-out:hover {
  color: #effbf6;
}

.score-splash__opt-out-input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--ziqavo-mint);
  cursor: pointer;
}

.score-splash__opt-out-input:focus-visible {
  outline: 3px solid #effbf6;
  outline-offset: 2px;
}

/* Logo: unchanged asset, bottom centre, with brand clear space. */
.score-splash__logo {
  position: absolute;
  bottom: clamp(1.5rem, 5vh, 3rem);
  left: 50%;
  width: clamp(104px, 10vw, 132px);
  height: auto;
  translate: -50% 0;
  animation: score-splash-rise 1s cubic-bezier(0.2, 0.8, 0.2, 1) 1.6s both;
}

@media (prefers-reduced-motion: reduce) {
  .score-splash {
    display: none;
  }
}

@keyframes score-splash-in {
  from {
    opacity: 0;
  }
}
@keyframes score-splash-out {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
@keyframes score-splash-leave {
  to {
    opacity: 0;
    transform: scale(1.06);
    filter: blur(6px);
  }
}
@keyframes score-splash-aurora {
  to {
    transform: translate(6%, -4%) rotate(12deg) scale(1.1);
  }
}
@keyframes score-splash-grid {
  to {
    background-position: 0 64px;
  }
}
@keyframes score-splash-fade {
  from {
    opacity: 0;
  }
}
@keyframes score-splash-spin {
  to {
    rotate: 360deg;
  }
}

@keyframes score-splash-tracking {
  from {
    opacity: 0;
    letter-spacing: 1em;
    filter: blur(4px);
  }
}

@keyframes score-splash-letter {
  from {
    opacity: 0;
    transform: translateY(0.5em) rotate(-8deg);
    filter: blur(8px);
  }
}

@keyframes score-splash-pop {
  from {
    opacity: 0;
    transform: scale(0.2) rotate(-90deg);
  }
}

@keyframes score-splash-fill {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes score-splash-count {
  to {
    --score-splash-value: 100;
  }
}

@keyframes score-splash-glow {
  50% {
    filter: drop-shadow(0 0 0.08em rgb(42 255 179 / 0.7));
  }
}

@keyframes score-splash-spark {
  0% {
    opacity: 0;
    transform: translate(var(--sx), var(--sy)) scale(0.3) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
    transform: translate(0, 0) scale(1.2) rotate(270deg);
  }
  100% {
    opacity: 0;
    transform: translate(0, 0) scale(0) rotate(360deg);
  }
}

@keyframes score-splash-bubble {
  from {
    opacity: 0;
    scale: 0;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

@keyframes score-splash-typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-0.02em);
    opacity: 1;
  }
}

@keyframes score-splash-step {
  from {
    opacity: 0.35;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    color: #effbf6;
    border-color: rgb(70 245 173 / 0.6);
    background: rgb(70 245 173 / 0.1);
  }
}

@keyframes score-splash-rise {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
}
@keyframes score-splash-progress {
  to {
    transform: scaleX(1);
  }
}

@keyframes score-splash-ping {
  70%,
  100% {
    box-shadow: 0 0 0 0.9rem rgb(70 245 173 / 0);
  }
}
