/* Nerven – Startseite: Gruß, Kacheln, Fußleiste */

body.start { --zettel-unten: 120px; }

/* Auf dem Desktop bleibt die Spalte handyschmal */
.kacheln, .fuss { width: 100%; max-width: 520px; align-self: center; }
.gruss { max-width: 520px; align-self: center; }

.gruss {
  margin: 12px 20px 0;
  min-height: 2.3em;
  font-family: var(--schrift-hand);
  font-size: clamp(21px, 5.8vw, 27px);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
}

.kacheln {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(88px, 1fr)) minmax(62px, .62fr);
  grid-auto-rows: minmax(88px, 1fr);
  gap: 16px 14px;
  padding: 16px 16px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.kachel {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 4px;
  padding: 16px 8px 10px;
  background: var(--zettel); color: var(--zettel-text);
  border: 0; border-radius: 3px;
  box-shadow: 0 5px 12px var(--schatten);
  transform: rotate(var(--neigung, 0deg));
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.kachel::before {
  content: ""; position: absolute; top: -8px; left: 50%;
  width: 56px; height: 16px;
  transform: translateX(-50%) rotate(2deg);
  background: var(--tape);
}
.kachel.breit { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 14px; padding: 10px 14px 8px; }
.kachel.breit .kachel-bild { flex: none; width: auto; height: 100%; }
.kachel.breit .kachel-bild svg { height: 48px; width: 48px; }
.kachel.breit .kachel-name { text-align: left; }
.kachel:active { transform: rotate(var(--neigung, 0deg)) scale(.96); box-shadow: 0 2px 5px var(--schatten); }

.kachel-bild { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.kachel-bild svg { height: 100%; max-height: 88px; width: auto; max-width: 100%; }

.kachel-name {
  font-family: var(--schrift-titel);
  font-size: clamp(14px, 4.2vw, 18px);
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  letter-spacing: .01em;
}

.bald-stempel {
  position: absolute; top: 12px; right: 6px;
  padding: 3px 7px 2px;
  border: 2px solid var(--rot); border-radius: 4px;
  font-family: var(--schrift-titel); font-size: 13px; line-height: 1;
  color: var(--rot);
  transform: rotate(7deg);
  opacity: .9;
}
.kachel.bald .kachel-bild { opacity: .55; }

/* Eine Zeile: Fußzeile mittig, Zahnrad rechts daneben */
.fuss { position: relative; display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 70px 6px; }
.fuss-leiste { position: absolute; right: 14px; bottom: 4px; }
.fuss-zeile { width: 100%; max-width: none; margin: 0; text-align: center; font-size: 12px; line-height: 1.2; color: var(--text-leise); }
.fuss-zeile a { display: inline-block; padding: 6px 2px; color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Niedrige Bildschirme, z. B. iPhone X in Safari mit Leisten (375 × 635) */
@media (max-height: 700px) {
  .gruss { margin-top: 6px; font-size: clamp(19px, 5.2vw, 24px); }
  .kacheln { padding: 12px 16px 6px; gap: 10px 12px; grid-template-rows: repeat(4, minmax(80px, 1fr)) minmax(58px, .62fr); grid-auto-rows: minmax(80px, 1fr); }
  .kachel { padding-top: 12px; }
  .kachel.breit { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .kachel { transition: none; }
  .kachel:active { transform: rotate(var(--neigung, 0deg)); }
}
