* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fff8ee; color: #3a2e25;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; cursor: pointer; border: 0; }
.screen { display: none; position: fixed; inset: 0; }
.screen.active { display: flex; }
.center { flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; padding: 24px; }
.hint { color: #8a7766; font-size: 18px; max-width: 34em; line-height: 1.4; }
.big-btn {
  font-size: 28px; font-weight: 700; padding: 24px 48px; border-radius: 999px;
  background: #ffb347; color: #3a2e25; box-shadow: 0 6px 0 #d98b1f;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #d98b1f; }
.big-btn.green { background: #3ecf6b; color: #fff; box-shadow: 0 6px 0 #26a34f; }
.big-btn.red { background: #ef4b4b; color: #fff; box-shadow: 0 6px 0 #b72f2f; }
.big-btn.grey { background: #e4dbd0; color: #6b5a4b; box-shadow: 0 6px 0 #c2b5a6; }
.small-btn { padding: 10px 18px; border-radius: 12px; background: #efe5d8; font-size: 16px; }
.small-btn.red { background: #fbd5d5; color: #8b1c1c; }

/* ---------- Kindertelefon ---------- */
#home { flex-direction: column; }
.contacts {
  flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 5vmin; padding: 5vmin;
}
.contact {
  display: flex; flex-direction: column; align-items: center; gap: 2vmin;
  background: none; padding: 0;
}
.contact .photo {
  width: 34vmin; height: 34vmin; border-radius: 50%;
  background: #e4dbd0 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 18vmin;
  border: 2.2vmin solid #cfc3b5;
  filter: grayscale(1) opacity(.55);
  transition: filter .4s, border-color .4s, transform .15s;
}
.contact .name { font-size: 5vmin; font-weight: 700; color: #b1a291; transition: color .4s; }
.contact.available .photo {
  filter: none; border-color: #3ecf6b;
  animation: glow 1.6s ease-in-out infinite;
}
.contact.available .name { color: #26a34f; }
.contact:active .photo { transform: scale(.95); }
.contact.nope .photo { animation: wiggle .4s; }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 207, 107, .7); }
  50% { box-shadow: 0 0 0 4vmin rgba(62, 207, 107, 0); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); }
}
.corner { position: fixed; top: 12px; right: 12px; display: flex; gap: 8px; align-items: center; z-index: 5; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #ef4b4b; }
.dot.on { background: #3ecf6b; }
.gear { background: transparent; font-size: 26px; opacity: .45; }
.gear:hover { opacity: 1; }
.gear.holding { opacity: 1; animation: spin 2s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Anruf ---------- */
#call { background: #1d1712; }
#remoteVideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #1d1712; }
#localVideo {
  position: absolute; right: 16px; bottom: 16px; width: 22vmin; border-radius: 16px;
  transform: scaleX(-1); border: 3px solid rgba(255, 255, 255, .6); background: #000;
}
.calling {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; color: #fff; font-size: 28px; font-weight: 700; background: #2b2119;
}
.calling .photo {
  width: 40vmin; height: 40vmin; border-radius: 50%; background: #e4dbd0 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 20vmin;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.06); } }
.hangup {
  position: absolute; left: 50%; bottom: 5vmin; transform: translateX(-50%);
  width: 20vmin; height: 20vmin; max-width: 140px; max-height: 140px; border-radius: 50%;
  background: #ef4b4b; color: #fff; font-size: 9vmin; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); z-index: 3;
}

/* ---------- Einstellungen ---------- */
#settings { flex-direction: column; overflow: auto; padding: 24px; gap: 16px; background: #fff; user-select: text; -webkit-user-select: text; }
#settings h2 { margin: 0; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.card { border: 1px solid #eadfd2; border-radius: 16px; padding: 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.card .thumb { width: 72px; height: 72px; border-radius: 50%; background: #e4dbd0 center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.card .qr img { width: 160px; height: 160px; image-rendering: pixelated; }
.card .link { font-size: 13px; word-break: break-all; color: #6b5a4b; max-width: 420px; }
input[type=text] { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid #d8cbbb; }
.warn { background: #fff1d6; border-radius: 12px; padding: 12px 16px; }

/* ---------- Großeltern ---------- */
.oma-status { font-size: 20px; color: #6b5a4b; }
.countdown { font-size: 56px; font-weight: 800; color: #26a34f; }
.ring-photo {
  width: 50vmin; height: 50vmin; border-radius: 50%; background: #ffe0b8;
  display: flex; align-items: center; justify-content: center; font-size: 26vmin;
  animation: pulse 0.8s ease-in-out infinite;
}
.stack { display: flex; flex-direction: column; gap: 18px; align-items: stretch; width: min(90vw, 420px); }

.gear-hint { font-size: 14px; background: rgba(0, 0, 0, .65); color: #fff; padding: 6px 10px; border-radius: 10px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.gear-hint.show { opacity: 1; }

.push-box { font-size: 16px; color: #6b5a4b; display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: 420px; }
.push-box.on { color: #26a34f; }

/* ---------- Grüße (Emojis) ---------- */
.greet-btn {
  position: fixed; left: 50%; bottom: 4vmin; transform: translateX(-50%); z-index: 3;
  width: 16vmin; height: 16vmin; border-radius: 50%; font-size: 9vmin;
  background: #ffd45c; box-shadow: 0 1.2vmin 0 #d9a92a, 0 0 0 1.2vmin rgba(255, 255, 255, .5);
  animation: greet-bob 3s ease-in-out infinite;
}
.greet-btn:active { transform: translateX(-50%) translateY(.8vmin); box-shadow: 0 .4vmin 0 #d9a92a; }
@keyframes greet-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1vmin; } }
.greet { background: linear-gradient(135deg, #ffe3f1, #e9e1ff 50%, #dff6ff); flex-direction: column; }
body.theme-weltall .greet { background: linear-gradient(#0c1445, #1c1060); }
.greet-close {
  position: absolute; top: 3vmin; left: 3vmin; width: 12vmin; height: 12vmin; border-radius: 50%;
  font-size: 6vmin; background: rgba(255, 255, 255, .85); color: #3a2e25;
}
.greet-step { display: flex; flex-direction: column; align-items: center; gap: 3vmin; }
.greet-title { font-size: 10vmin; }
.emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2.5vmin; }
.emoji-btn {
  width: 15vmin; height: 15vmin; border-radius: 4vmin; font-size: 9vmin; line-height: 1;
  background: rgba(255, 255, 255, .9); box-shadow: 0 1vmin 0 rgba(0, 0, 0, .12);
  transition: transform .1s;
}
.emoji-btn:active { transform: scale(.9); }
.greet-chosen { font-size: 22vmin; line-height: 1; animation: pulse 1s ease-in-out infinite; }
.greet-arrow { font-size: 7vmin; }
.greet-people { display: flex; gap: 5vmin; flex-wrap: wrap; justify-content: center; }
.greet-person { display: flex; flex-direction: column; align-items: center; gap: 1.5vmin; background: none; }
.greet-person .photo {
  width: 24vmin; height: 24vmin; border-radius: 50%; background: #e4dbd0 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 13vmin;
  border: 1.4vmin solid #ffd45c; box-shadow: 0 1vmin 0 rgba(0, 0, 0, .12);
}
.greet-person .name { font-size: 5vmin; font-weight: 700; color: #6c5ce7; }
body.theme-weltall .greet-person .name { color: #b9b3ff; }
.greet-fly { position: absolute; left: 50%; top: 50%; font-size: 30vmin; transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none; z-index: 10; }
.greet-fly.go { animation: fly-away 1.4s ease-in forwards; }
@keyframes fly-away {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  45% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -260%) scale(.3) rotate(25deg); opacity: 0; }
}

/* ---------- Großeltern: empfangene Grüße ---------- */
.greeting-pop {
  position: fixed; inset: 0; z-index: 20; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: rgba(255, 248, 238, .96); text-align: center; padding: 24px;
}
.greeting-pop.show { display: flex; }
.greeting-pop .big { font-size: 40vmin; line-height: 1; animation: pop-in .6s cubic-bezier(.2, 1.6, .4, 1) both, pulse 1.4s ease-in-out .6s infinite; }
.greeting-pop .txt { font-size: 26px; font-weight: 700; }
@keyframes pop-in { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }
.greetings { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 16px; color: #6b5a4b; }
.greetings .row-e { font-size: 30px; letter-spacing: 4px; }
