/* ==========================================================================
   Cookie Clash – Startseite und Keks-Grafik
   ========================================================================== */

.screen-home {
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 3vw, 32px) clamp(20px, 5vw, 64px) clamp(24px, 4vw, 48px);
}

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "head head"
    "art copy";
  align-items: center;
  gap: 0 clamp(24px, 4.5vw, 64px);
  width: min(1160px, 100%);
}

.home-head {
  grid-area: head;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 4px;
  margin-bottom: clamp(8px, 2vh, 22px);
}

/* --------------------------------------------------------------------------
   Keks
   -------------------------------------------------------------------------- */

.cookie {
  position: relative;
  border-radius: 50%;
  background:
    radial-gradient(circle at 33% 27%, rgba(255, 240, 196, 0.8), transparent 35%),
    radial-gradient(circle at 70% 76%, rgba(108, 56, 18, 0.22), transparent 48%),
    radial-gradient(circle at 52% 46%, #e6b26c 0%, #d59a51 52%, #c08340 78%, #a9692e 100%);
  box-shadow:
    inset 0 -16px 28px rgba(94, 48, 14, 0.32),
    inset 0 12px 26px rgba(255, 228, 175, 0.42),
    0 26px 55px rgba(90, 50, 20, 0.24);
}

.cookie::before {
  content: "";
  position: absolute;
  inset: 5%;
  z-index: 0;
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 38%, rgba(118, 68, 28, 0.4) 0 0.7%, transparent 1.1%),
    radial-gradient(circle at 39% 22%, rgba(118, 68, 28, 0.3) 0 0.6%, transparent 1%),
    radial-gradient(circle at 78% 34%, rgba(118, 68, 28, 0.35) 0 0.8%, transparent 1.2%),
    radial-gradient(circle at 62% 62%, rgba(255, 236, 194, 0.5) 0 0.6%, transparent 1%),
    radial-gradient(circle at 31% 72%, rgba(118, 68, 28, 0.35) 0 0.7%, transparent 1.1%),
    radial-gradient(circle at 83% 68%, rgba(255, 236, 194, 0.4) 0 0.5%, transparent 0.9%),
    radial-gradient(circle at 50% 90%, rgba(118, 68, 28, 0.3) 0 0.6%, transparent 1%);
}

.chip {
  position: absolute;
  z-index: 1;
  aspect-ratio: 1 / 0.92;
  border-radius: 46% 54% 52% 48% / 56% 44% 56% 44%;
  background: radial-gradient(circle at 34% 26%, #8a5a34 0%, #4a2a15 58%, #2f1a0c 100%);
  box-shadow:
    inset 0 2px 2px rgba(255, 221, 180, 0.25),
    0 2px 4px rgba(70, 35, 10, 0.4);
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  pointer-events: none;
}

.chip:nth-child(3n + 2) {
  filter: brightness(1.12);
}

.cookie-gloss {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.27), transparent 38%);
}

.cookie--hero {
  width: clamp(270px, 26vw, 400px);
  aspect-ratio: 1;
  z-index: 2;
  animation: hero-bob 7s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Hero-Kunst
   -------------------------------------------------------------------------- */

.home-art {
  grid-area: art;
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(64vh, 580px);
}

.art-halo {
  position: absolute;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 202, 112, 0.52), rgba(255, 202, 112, 0) 68%);
  filter: blur(10px);
}

.orbit {
  position: absolute;
  border: 1.5px dashed rgba(160, 112, 60, 0.2);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-a {
  width: 88%;
  aspect-ratio: 1;
  animation: orbit-spin 80s linear infinite;
}

.orbit-b {
  width: 68%;
  aspect-ratio: 1;
  border-style: solid;
  border-color: rgba(233, 162, 59, 0.16);
  animation: orbit-spin 54s linear infinite reverse;
}

.spark {
  position: absolute;
  width: 15px;
  height: 15px;
  z-index: 3;
  background: #eeb35a;
  opacity: 0.72;
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  animation: twinkle 3.6s ease-in-out infinite;
}

.spark-a {
  top: 12%;
  left: 21%;
}

.spark-b {
  top: 23%;
  right: 12%;
  width: 21px;
  height: 21px;
  animation-delay: -1.2s;
}

.spark-c {
  bottom: 19%;
  left: 8%;
  width: 11px;
  height: 11px;
  animation-delay: -2.3s;
}

.spark-d {
  right: 22%;
  bottom: 9%;
  width: 9px;
  height: 9px;
  animation-delay: -0.6s;
}

.score-chip {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow-soft);
  font-size: 0.88rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.score-chip i {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
}

.score-chip b {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chip-you {
  top: 8%;
  left: 0;
  transform: rotate(-4deg);
}

.chip-you i {
  background: var(--you);
}

.chip-rival {
  right: 0;
  bottom: 12%;
  transform: rotate(3deg);
}

.chip-rival i {
  background: var(--rival);
}

.art-target {
  position: absolute;
  bottom: 1%;
  left: 50%;
  z-index: 4;
  padding: 7px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--ink-3);
  background: rgba(255, 250, 240, 0.82);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  transform: translateX(-50%);
  white-space: nowrap;
}

.art-target b {
  margin-left: 3px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.cursor-tag {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}

.cursor-tag svg {
  width: 27px;
  height: 27px;
  filter: drop-shadow(0 3px 4px rgba(60, 30, 10, 0.28));
}

.cursor-tag span {
  margin-top: -3px;
  margin-left: 14px;
  padding: 3px 9px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 10px rgba(60, 30, 10, 0.2);
}

.cursor-you {
  top: 38%;
  left: 1%;
}

.cursor-you svg {
  fill: var(--you);
  stroke: #fffdf8;
  stroke-width: 1.4;
  transform: scaleX(-1) rotate(-10deg);
}

.cursor-you span {
  background: var(--you);
}

.cursor-rival {
  top: 30%;
  right: 0;
}

.cursor-rival svg {
  fill: var(--rival);
  stroke: #fffdf8;
  stroke-width: 1.4;
  transform: rotate(8deg);
}

.cursor-rival span {
  background: var(--rival);
}

.mini-golden {
  position: absolute;
  top: 8%;
  right: 9%;
  z-index: 3;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 27%, #fff4b7 0%, #f6c453 45%, #d99b2b 80%, #b87a16 100%);
  box-shadow:
    0 0 0 7px rgba(246, 196, 83, 0.14),
    0 0 26px rgba(246, 196, 83, 0.55),
    inset 0 -7px 12px rgba(150, 95, 10, 0.3);
  animation: float-soft 5s ease-in-out infinite;
}

.mini-golden::before {
  content: "";
  position: absolute;
  top: 27%;
  left: 29%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 248, 200, 0.9);
  box-shadow:
    20px 8px 0 -2px rgba(255, 248, 200, 0.9),
    8px 25px 0 -2px rgba(255, 248, 200, 0.9),
    29px 29px 0 -3px rgba(255, 248, 200, 0.9);
}

.golden-spark {
  position: absolute;
  top: -15px;
  right: -13px;
  width: 20px;
  height: 20px;
  background: #e7a62c;
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  animation: twinkle 1.8s ease-in-out infinite;
}

.golden-mult {
  position: absolute;
  right: -16px;
  bottom: -11px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffd86b;
  background: #4a2d18;
  box-shadow: 0 4px 10px rgba(60, 30, 10, 0.25);
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Hero-Text und Formular
   -------------------------------------------------------------------------- */

.home-copy {
  grid-area: copy;
  width: 100%;
  max-width: 580px;
}

.home-copy h1 {
  max-width: 7.5ch;
  margin: 12px 0 16px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 6vw, 5.9rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.92;
}

.title-accent {
  color: var(--caramel-deep);
}

.title-dot {
  color: var(--rival);
}

.lede {
  max-width: 34rem;
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: clamp(1.01rem, 1.2vw, 1.13rem);
  line-height: 1.55;
}

.lede strong {
  color: var(--ink);
  font-weight: 900;
}

.invite-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
  padding: 10px 13px;
  border: 1px solid rgba(233, 162, 59, 0.38);
  border-radius: 13px;
  color: #7b551d;
  background: #fff3d4;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.4;
}

.invite-note b {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.invite-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  color: #fff;
  background: var(--caramel);
  font-size: 0.68rem;
}

.home-form {
  padding: clamp(17px, 2vw, 24px);
  border-radius: 24px;
}

.home-form .btn-primary {
  margin-top: 14px;
}

.join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.join-row .btn {
  min-width: 132px;
}

.form-hint {
  margin: 12px 0 0;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.form-hint.is-error {
  color: var(--rival-dark);
  font-weight: 800;
}

.how {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 700;
}

.how li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.how li span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--ink-2);
  background: #f0dfc6;
  font-size: 0.66rem;
  font-weight: 900;
}

/* --------------------------------------------------------------------------
   Animationen
   -------------------------------------------------------------------------- */

@keyframes hero-bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-12px) rotate(1.2deg);
  }
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0) rotate(4deg);
  }
  50% {
    transform: translateY(-9px) rotate(-2deg);
  }
}

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

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.75) rotate(0deg);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.15) rotate(45deg);
  }
}

/* --------------------------------------------------------------------------
   Responsiv
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .home-shell {
    gap: 0 28px;
  }

  .cookie--hero {
    width: min(31vw, 330px);
  }

  .home-art {
    min-height: 480px;
  }

  .home-copy h1 {
    font-size: clamp(3.5rem, 6.4vw, 5rem);
  }
}

@media (max-height: 780px) and (min-width: 881px) {
  .home-copy h1 {
    font-size: clamp(3.2rem, 5.4vw, 4.7rem);
  }

  .home-art {
    min-height: 480px;
  }

  .cookie--hero {
    width: clamp(250px, 23vw, 330px);
  }

  .lede {
    margin-bottom: 16px;
  }

  .home-form {
    padding: 17px;
  }

  .how {
    display: none;
  }
}

@media (max-width: 880px) {
  .screen-home {
    align-items: flex-start;
    padding: 18px 20px 36px;
  }

  .home-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "head"
      "copy";
    width: min(600px, 100%);
  }

  .home-head {
    margin-bottom: clamp(20px, 5vh, 44px);
  }

  .home-art {
    display: none;
  }

  .home-copy {
    max-width: none;
  }

  .home-copy h1 {
    max-width: none;
    font-size: clamp(3.6rem, 13vw, 5.2rem);
    margin-top: 14px;
  }

  .lede {
    max-width: 34rem;
  }

  .home-form {
    max-width: 540px;
  }

  .how {
    max-width: 540px;
  }
}

@media (max-width: 540px) {
  .screen-home {
    padding: 14px 14px 30px;
  }

  .home-head {
    margin-bottom: 24px;
  }

  .home-copy h1 {
    font-size: clamp(3.35rem, 16vw, 4.3rem);
    margin-bottom: 12px;
  }

  .lede {
    margin-bottom: 18px;
    font-size: 1rem;
  }

  .home-form {
    padding: 15px;
    border-radius: 20px;
  }

  .join-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .join-row .btn {
    width: 100%;
  }

  .field-code input {
    letter-spacing: 0.65em;
  }

  .field-label {
    font-size: 0.68rem;
  }

  .how {
    gap: 7px 12px;
    font-size: 0.74rem;
    margin-top: 14px;
  }
}
