:root {
  --bg: #03060c;
  --text: #eef4fb;
  --muted: #7d8a9b;
  --cyan: #2fd3ff;
  --violet: #7b6cf0;
  --danger: #ff5d7a;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --radius: 24px;
  --grad: linear-gradient(135deg, #2fd3ff 0%, #7b6cf0 100%);
  --tabbar-h: 78px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Unterwasser bei Nacht: Licht von oben, Tiefe nach unten */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(90% 55% at 50% -8%, rgba(120, 230, 255, 0.28) 0%, rgba(60, 140, 230, 0.14) 28%, transparent 58%),
    radial-gradient(140% 90% at 50% 50%, rgba(20, 60, 110, 0.35) 0%, transparent 70%),
    linear-gradient(180deg, #06101f 0%, #04070f 55%, #02040a 100%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 16px) 18px
           calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}

.screen { display: none; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 2px 18px;
}
.brand { font-size: 1.7rem; font-weight: 800; margin: 0; letter-spacing: -0.5px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.flame-pill {
  background: var(--card); border: 1px solid var(--card-border);
  padding: 7px 13px; border-radius: 30px; font-weight: 700; font-size: 0.95rem;
}
.flame-pill b { color: var(--cyan); }
.icon-btn {
  background: var(--card); border: 1px solid var(--card-border);
  font-size: 1.2rem; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 12px; }

/* ===================== Motivation oben ===================== */
.motivation-top {
  text-align: center;
  margin: -6px 0 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #b7c6dc;
  font-style: italic;
  letter-spacing: 0.2px;
  min-height: 1.2em;
}

/* Stimmungs-Chip */
.mood-row { display: flex; justify-content: center; margin-bottom: 12px; }
.mood-chip {
  background: var(--card); border: 1px solid var(--card-border); color: var(--text);
  padding: 8px 16px; border-radius: 30px; font-weight: 700; font-size: 0.9rem; cursor: pointer;
}

/* Brief-Popup (fliegt rein) */
.letter-pop {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(3,6,10,0.5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.letter-pop[hidden] { display: none; }
.letter-note {
  background: linear-gradient(160deg, #ffffff, #eaf2ff);
  color: #1a2438; border-radius: 24px; padding: 24px 26px;
  max-width: 320px; width: 100%; text-align: center;
  box-shadow: 0 26px 64px rgba(0,0,0,0.55), 0 0 40px rgba(70,200,255,0.25);
  animation: letterFly 0.75s cubic-bezier(0.2, 0.9, 0.25, 1.25) both;
}
.letter-paw { font-size: 2.4rem; margin-bottom: 6px; animation: pawWiggle 0.8s ease 0.5s 2; }
.letter-note p { margin: 0 0 10px; font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.letter-from { font-size: 0.85rem; color: #6b7488; font-weight: 700; font-style: italic; }
@keyframes letterFly {
  0%   { transform: translate(55vw, 55vh) rotate(28deg) scale(0.35); opacity: 0; }
  55%  { opacity: 1; }
  100% { transform: translate(0,0) rotate(0) scale(1); opacity: 1; }
}
@keyframes pawWiggle { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

/* ===================== Ziel-Feier ===================== */
.celebrate {
  position: fixed; inset: 0; z-index: 180;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 24px;
  background:
    radial-gradient(70% 45% at 50% 38%, rgba(47,211,255,0.35) 0%, rgba(123,108,240,0.22) 40%, transparent 72%),
    linear-gradient(180deg, #08111f 0%, #04070f 100%);
  overflow: hidden;
}
.celebrate[hidden] { display: none; }
.celebrate-band {
  position: absolute; left: -20%; right: -20%; top: 40%; height: 230px;
  transform: rotate(-12deg);
  background: linear-gradient(90deg, transparent, rgba(47,211,255,0.18), rgba(123,108,240,0.18), transparent);
  filter: blur(4px); pointer-events: none;
}
.celebrate-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.celebrate-confetti i {
  position: absolute; top: -16px; width: 10px; height: 14px; border-radius: 2px; opacity: 0;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(108vh) rotate(620deg); opacity: 0.9; }
}
.celebrate-stage { position: relative; z-index: 1; margin-bottom: 10px; }
.celebrate-dog-slot {
  animation: celebrateDogIn 0.9s cubic-bezier(0.22, 1, 0.3, 1.4) both;
}
.celebrate-dog-slot .dog { width: 210px; }
.celebrate .bowl { display: none; }
@keyframes celebrateDogIn {
  0% { transform: translateY(115vh) scale(0.45) rotate(-14deg); opacity: 0; }
  55% { opacity: 1; }
  72% { transform: translateY(-22px) scale(1.1) rotate(4deg); }
  100% { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}
.celebrate-medal {
  position: absolute; right: 8%; bottom: 14%;
  font-size: 3rem; z-index: 2;
  animation: medalPop 0.5s cubic-bezier(0.34, 1.7, 0.5, 1) 0.7s both;
  filter: drop-shadow(0 4px 10px rgba(255,209,102,0.6));
}
@keyframes medalPop { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }
.celebrate-title {
  font-size: 2.6rem; font-weight: 900; margin: 8px 0 4px; text-align: center; z-index: 1;
  background: linear-gradient(135deg, #ffd166, #ffb020);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: titlePop 0.5s cubic-bezier(0.34, 1.7, 0.5, 1) 0.5s both;
}
@keyframes titlePop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.celebrate-sub { color: #d6deea; font-weight: 600; text-align: center; margin: 0 0 22px; z-index: 1;
  animation: titlePop 0.5s ease 0.75s both; }
.celebrate .celebrate-btn { width: 100%; max-width: 280px; flex: 0 0 auto; z-index: 1;
  animation: titlePop 0.5s ease 0.9s both; }

/* Stimmungs-Modal */
.mood-card {
  background: #0e141c; border: 1px solid var(--card-border);
  border-radius: 28px; padding: 26px 22px; text-align: center;
  max-width: 380px; width: 100%;
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mood-card h2 { margin: 0 0 4px; }
.mood-sub { margin: 0 0 18px; color: var(--muted); font-size: 0.9rem; }
.mood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.mood-opt {
  background: rgba(255,255,255,0.05); border: 1px solid var(--card-border);
  border-radius: 18px; padding: 16px 6px; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600;
}
.mood-opt .mood-emoji { font-size: 1.7rem; }
.mood-opt:active { transform: scale(0.96); }

/* ===================== Hero / Glas / Begleiter ===================== */
.hero {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 6px;
  margin-bottom: 26px;
}
.hero-glow {
  position: absolute;
  top: 4%; left: 50%; transform: translateX(-50%);
  width: 360px; height: 340px;
  background: radial-gradient(circle, rgba(70,200,255,0.45) 0%, rgba(123,108,240,0.3) 40%, transparent 68%);
  filter: blur(22px);
  pointer-events: none;
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }

/* Engelsgleiches Licht von oben */
.light-rays {
  position: absolute;
  top: -24px; left: 50%; transform: translateX(-50%);
  width: 360px; height: 320px;
  background: repeating-linear-gradient(94deg,
    rgba(150, 230, 255, 0.10) 0px, rgba(150, 230, 255, 0.10) 10px,
    transparent 10px, transparent 38px);
  filter: blur(5px);
  -webkit-mask: radial-gradient(ellipse 70% 90% at 50% 0%, #000 0%, transparent 72%);
  mask: radial-gradient(ellipse 70% 90% at 50% 0%, #000 0%, transparent 72%);
  pointer-events: none;
  animation: rays 9s ease-in-out infinite;
}
@keyframes rays { 0%,100% { opacity: 0.45; } 50% { opacity: 0.9; } }

/* Aufsteigende Blasen */
.bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubbles span {
  position: absolute; bottom: -10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(180, 235, 255, 0.18);
  box-shadow: inset 0 0 4px rgba(255,255,255,0.4);
  animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  12% { opacity: 0.7; }
  100% { transform: translateY(-280px) scale(1); opacity: 0; }
}
.bubbles span:nth-child(1){ left: 18%; width: 6px; height: 6px; animation-duration: 7s; animation-delay: 0s; }
.bubbles span:nth-child(2){ left: 30%; width: 10px; height: 10px; animation-duration: 9s; animation-delay: 1.4s; }
.bubbles span:nth-child(3){ left: 44%; width: 5px; height: 5px; animation-duration: 6s; animation-delay: 2.6s; }
.bubbles span:nth-child(4){ left: 58%; width: 9px; height: 9px; animation-duration: 8.5s; animation-delay: 0.7s; }
.bubbles span:nth-child(5){ left: 68%; width: 6px; height: 6px; animation-duration: 7.5s; animation-delay: 3.2s; }
.bubbles span:nth-child(6){ left: 78%; width: 11px; height: 11px; animation-duration: 10s; animation-delay: 1.9s; }
.bubbles span:nth-child(7){ left: 50%; width: 4px; height: 4px; animation-duration: 5.5s; animation-delay: 4s; }

.hero-stage {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 4px;
}

.glass {
  position: relative;
  width: 158px; height: 220px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top: none;
  border-radius: 16px 16px 40px 40px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
  box-shadow: 0 0 70px rgba(70, 200, 255, 0.35), inset 0 0 34px rgba(255,255,255,0.06);
  backdrop-filter: blur(4px);
}
.glass-fill {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 0%;
  background: linear-gradient(180deg, rgba(80,225,255,0.95) 0%, rgba(123,108,240,0.92) 100%);
  box-shadow: 0 -4px 36px rgba(70, 210, 255, 0.7);
  transition: height 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.glass-fill::before {
  content: ""; position: absolute; top: -9px; left: 0;
  width: 200%; height: 18px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  animation: wave 3s linear infinite;
}
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* Schillernde Opal-Oberfläche */
.glass-iri {
  position: absolute; inset: 0; pointer-events: none;
  background: conic-gradient(from 210deg at 35% 30%,
    rgba(255, 90, 170, 0.18), rgba(120, 220, 255, 0.18),
    rgba(150, 255, 200, 0.16), rgba(180, 130, 255, 0.18), rgba(255, 90, 170, 0.18));
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { 0%{ transform: rotate(0) scale(1.2);} 100%{ transform: rotate(360deg) scale(1.2);} }
.glass-shine {
  position: absolute; top: 12px; left: 16px;
  width: 22px; height: 68%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent);
  border-radius: 20px;
  pointer-events: none;
}
.glass-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.9rem; color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.5);
  pointer-events: none;
}
.glass-label .unit { font-size: 1rem; }
.goal-label { font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.75); margin-top: 4px; }
.pedestal {
  width: 230px; height: 22px; margin-top: 2px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, transparent 72%);
  border-radius: 50%;
}

/* ===================== Begleiter (Hund) ===================== */
.dog {
  width: 130px; height: auto;
  margin-bottom: 2px;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.35)) drop-shadow(0 0 16px rgba(70,200,255,0.22));
}
.dog .dog-rig {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: dogIdle 4.5s ease-in-out infinite;
}
@keyframes dogIdle {
  0%,100% { transform: translateY(0) rotate(-1.6deg); }
  50% { transform: translateY(-4px) rotate(1.6deg); }
}

/* Hundenapf */
.dog .bowl-body { fill: url(#collarG); }
.dog .bowl-rim { fill: #38456a; }
.dog .bowl-water { fill: #5fe0ff; opacity: 0.9; }

/* Name unter dem Hund */
.dog-col { display: flex; flex-direction: column; align-items: center; }
.dog-caption {
  margin-top: 2px;
  font-size: 0.98rem; font-weight: 700; letter-spacing: 0.2px;
  color: #eef4fb;
}
.dog-caption:empty { display: none; }
.dog .dog-shadow { fill: rgba(0,0,0,0.4); }
.dog .eye { fill: #241d1a; }
.dog .nose { fill: #241d1a; }
.dog .shine { fill: #ffffff; }
.dog .muzzle { opacity: 0.96; }
.dog .philtrum { stroke: rgba(0,0,0,0.12); stroke-width: 2; stroke-linecap: round; }
.dog .mouth { fill: none; stroke: #241d1a; stroke-width: 3.2; stroke-linecap: round; }
.dog .m-open { fill: #241d1a; }
.dog .tongue { fill: #ff7a9c; }
.dog .brow path { fill: none; stroke: #241d1a; stroke-width: 3.6; stroke-linecap: round; }
.dog .spark { fill: #c2efff; }
.dog .heart { fill: #ff7a9c; }

/* Standardmäßig ausblenden */
.dog .m-ok, .dog .m-sad, .dog .m-skeptical, .dog .m-happy, .dog .m-open,
.dog .tongue, .dog .brow, .dog .spark, .dog .heart { display: none; }

/* Sichtbarkeit je Stimmung */
.dog.neutral .m-ok { display: block; }
.dog.sad .m-sad, .dog.sad .brow-sad { display: block; }
.dog.skeptical .m-skeptical, .dog.skeptical .brow-skeptical { display: block; }
.dog.happy .m-happy { display: block; }
.dog.ecstatic .m-open, .dog.ecstatic .tongue, .dog.ecstatic .spark, .dog.ecstatic .heart { display: block; }

/* ---- Dauer-Animationen (Leben) ---- */
.dog .body {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: dogBreathe 3.6s ease-in-out infinite;
}
@keyframes dogBreathe { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.03) translateY(-1px); } }

.dog .tail {
  transform-box: fill-box; transform-origin: 25% 90%;
  animation: dogTail 1.1s ease-in-out infinite;
}
@keyframes dogTail { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(15deg); } }
.dog.happy .tail, .dog.ecstatic .tail { animation-duration: 0.42s; }
.dog.skeptical .tail { animation-duration: 1.8s; }
.dog.sad .tail { animation-duration: 2.6s; }

.dog .eyes {
  transform-box: fill-box; transform-origin: center;
  animation: dogBlink 5s infinite;
}
@keyframes dogBlink { 0%,93%,100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }

.dog .ear { transform-box: fill-box; transform-origin: 50% 8%; transition: transform 0.45s ease; }
.dog.sad .ear-l { transform: rotate(15deg); }
.dog.sad .ear-r { transform: rotate(-15deg); }
.dog.skeptical .ear-l { transform: rotate(-7deg); }
.dog.skeptical .ear-r { transform: rotate(9deg); }
.dog.happy .ear-l, .dog.ecstatic .ear-l { transform: rotate(-13deg); }
.dog.happy .ear-r, .dog.ecstatic .ear-r { transform: rotate(13deg); }

.dog .head { transform-box: fill-box; transform-origin: 50% 100%; }
.dog.sad .head { transform: translateY(5px); }
.dog.happy .head { animation: dogTilt 3.2s ease-in-out infinite; }
@keyframes dogTilt { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.dog.ecstatic .dog-rig { animation: dogJump 0.62s ease-in-out infinite; }
@keyframes dogJump {
  0%,100% { transform: translateY(0) scaleY(1); }
  30% { transform: translateY(-15px) scaleY(1.05); }
  60% { transform: translateY(0) scaleY(0.96); }
}
.dog.ecstatic .spark, .dog.ecstatic .heart { animation: twinkle 1s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

.dog.bounce .dog-rig { animation: dogBounce 0.5s ease; }
@keyframes dogBounce {
  0% { transform: translateY(0) scale(1,1); }
  25% { transform: translateY(-2px) scale(1.06,0.92); }
  50% { transform: translateY(-15px) scale(0.95,1.07); }
  100% { transform: translateY(0) scale(1,1); }
}

/* ===================== Stat-Reihe ===================== */
.stat-row {
  display: flex;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px 4px;
  margin-bottom: 22px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative;
}
.stat + .stat::before {
  content: ""; position: absolute; left: 0; top: 14%; height: 72%;
  width: 1px; background: var(--card-border);
}
.stat-label { font-size: 0.66rem; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.stat-val { font-size: 1.35rem; font-weight: 800; }

/* ===================== Schnell-Eingabe ===================== */
.quick { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.add-btn {
  background: var(--grad); color: #04121b; border: none;
  border-radius: 18px; padding: 19px;
  font-size: 1.3rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 28px rgba(47, 211, 255, 0.28);
  transition: transform 0.12s ease;
}
.add-btn:active { transform: scale(0.97); }
.custom-add { display: flex; gap: 10px; }
.custom-add input {
  flex: 1 1 0; min-width: 0; width: 100%;
  padding: 16px; font-size: 1.1rem; color: var(--text);
  border: 1px solid var(--card-border); border-radius: 16px;
  background: var(--card);
}
.custom-add input::placeholder { color: var(--muted); }
.custom-add input:focus { outline: none; border-color: var(--cyan); }
.custom-add button {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.08); color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 16px; padding: 16px 22px;
  font-weight: 700; font-size: 1rem; cursor: pointer;
}
.undo-btn {
  background: transparent; color: var(--muted);
  border: 1px solid var(--card-border); border-radius: 16px;
  padding: 13px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}

/* ===================== Daily Insights ===================== */
.section-head { margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.insights {
  display: flex; gap: 14px; overflow-x: auto;
  margin: 0 -18px 26px; padding: 2px 18px 6px;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
}
.insights::-webkit-scrollbar { display: none; }
.insight-card {
  flex: 0 0 78%; scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 22px; padding: 20px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.insight-card.accent {
  background: linear-gradient(135deg, rgba(47,211,255,0.16), rgba(123,108,240,0.16));
  border-color: rgba(47, 211, 255, 0.3);
}
.insight-ico { font-size: 1.5rem; }
.insight-card h3 { margin: 10px 0 6px; font-size: 1rem; }
.insight-card p { margin: 10px 0 8px; line-height: 1.45; color: #d6deea; }

/* ===================== Foto ===================== */
.photo { margin-bottom: 26px; }
.photo-btn {
  display: block; text-align: center;
  background: var(--card); border: 1px dashed rgba(47, 211, 255, 0.4);
  color: var(--cyan); border-radius: var(--radius);
  padding: 18px; font-weight: 700; cursor: pointer;
}
.today-strip {
  display: flex; gap: 10px; margin-top: 14px;
  overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.today-strip::-webkit-scrollbar { display: none; }
.today-strip img {
  width: 76px; height: 76px; flex: 0 0 auto;
  object-fit: cover; border-radius: 16px; border: 1px solid var(--card-border);
}

/* ===================== Reminders ===================== */
.reminders { padding: 20px 22px; margin-bottom: 22px; }
.hint {
  font-size: 0.85rem; color: #b9c4d4;
  background: rgba(47, 211, 255, 0.07); border: 1px solid rgba(47,211,255,0.15);
  border-radius: 16px; padding: 14px; margin: 0 0 16px; line-height: 1.45;
}
.secondary-btn {
  display: block; width: 100%;
  background: rgba(255,255,255,0.06); color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 16px; padding: 16px;
  font-weight: 700; font-size: 1rem; cursor: pointer; margin-bottom: 10px;
}
.primary-btn {
  background: var(--grad); color: #04121b; border: none;
  border-radius: 16px; padding: 16px 20px;
  font-weight: 800; font-size: 1rem; cursor: pointer; flex: 1;
  box-shadow: 0 8px 22px rgba(47, 211, 255, 0.28);
}
.link-btn {
  background: none; border: none; color: var(--cyan);
  font-size: 0.95rem; font-weight: 600; cursor: pointer; padding: 6px;
}
.link-btn.danger { color: var(--danger); }
.footer { text-align: center; margin-top: 4px; }

/* ===================== Hall of Water ===================== */
/* Rang-Karte */
.rank-card { padding: 18px 20px; margin-bottom: 16px; }
.rank-top { display: flex; align-items: flex-start; justify-content: space-between; }
.rank-label { display: block; font-size: 0.66rem; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.rank-name {
  display: block; font-size: 1.5rem; font-weight: 800; margin-top: 2px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rank-streak { background: var(--card); border: 1px solid var(--card-border); padding: 7px 13px; border-radius: 30px; font-weight: 700; }
.rank-streak b { color: var(--cyan); }
.rank-bar { height: 10px; background: rgba(255,255,255,0.08); border-radius: 20px; margin: 16px 0 8px; overflow: hidden; }
.rank-fill { height: 100%; width: 0%; background: var(--grad); border-radius: 20px; transition: width 0.7s ease; }
.rank-next { font-size: 0.85rem; color: var(--muted); }

/* Stat-Grid */
.hall-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.hall-stat {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 20px; padding: 18px 8px; text-align: center;
  display: flex; flex-direction: column; gap: 5px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.hall-num {
  font-size: 1.7rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hall-label { font-size: 0.76rem; color: var(--muted); font-weight: 600; }

.calendar-card { padding: 18px 16px; margin-bottom: 20px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-nav span { font-weight: 700; font-size: 1.05rem; }
.cal-arrow {
  background: rgba(255,255,255,0.06); color: var(--text);
  border: 1px solid var(--card-border);
  width: 38px; height: 38px; border-radius: 12px;
  font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekdays { margin-bottom: 8px; }
.cal-weekdays span { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--muted); }
.cal-cell {
  position: relative; aspect-ratio: 1; border-radius: 12px;
  background: rgba(255,255,255,0.035);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  cursor: pointer; overflow: hidden; border: 1px solid transparent;
}
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.reached {
  background: var(--grad); color: #04121b;
  box-shadow: 0 4px 16px rgba(47, 211, 255, 0.3);
}
.cal-cell.today { border-color: var(--cyan); }
.cal-cell.selected { outline: 2px solid var(--cyan); outline-offset: -2px; }
.cal-cell .cell-photo { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; }
.cal-cell .cell-num { position: relative; z-index: 1; }
.cal-cell.has-photo .cell-num { color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,0.8); }
.cal-cell .cam-badge { position: absolute; bottom: 2px; right: 3px; font-size: 0.6rem; z-index: 2; }
.cal-legend {
  display: flex; align-items: center; gap: 18px; justify-content: center; margin-top: 14px;
  font-size: 0.76rem; color: var(--muted);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; line-height: 1; }
.cal-legend i.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.cal-legend i.d-goal { background: var(--cyan); }
.cal-legend i.d-foto { background: var(--violet); }
.cal-legend i.d-legend { background: #ffd166; }
.cal-cell.legendary { box-shadow: 0 0 0 2px #ffd166, 0 4px 16px rgba(255,209,102,0.4); }

/* Monatsübersicht */
.month-card { padding: 18px 20px; margin-bottom: 20px; }
.month-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
.month-stats .ms { display: flex; justify-content: space-between; border-bottom: 1px solid var(--card-border); padding-bottom: 8px; }
.month-stats .ms span:first-child { color: var(--muted); font-size: 0.88rem; }
.month-stats .ms b { font-weight: 800; }

/* Erfolge / Badges */
.achievements { padding: 18px 20px; margin-bottom: 20px; }
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.badge { text-align: center; opacity: 0.4; filter: grayscale(0.8); transition: 0.3s; }
.badge.unlocked { opacity: 1; filter: none; }
.badge-ico {
  width: 52px; height: 52px; margin: 0 auto 6px; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: var(--card); border: 1px solid var(--card-border);
}
.badge.unlocked .badge-ico { background: linear-gradient(135deg, rgba(47,211,255,0.2), rgba(123,108,240,0.2)); border-color: rgba(47,211,255,0.4); }
.badge-name { font-size: 0.66rem; color: var(--muted); font-weight: 600; line-height: 1.2; }
.badge.unlocked .badge-name { color: var(--text); }

.day-detail { padding: 20px 22px; }
.day-meta { color: var(--muted); margin: 0 0 6px; font-size: 0.9rem; }
.day-comment { color: var(--cyan); margin: 0 0 12px; font-size: 0.9rem; font-weight: 600; font-style: italic; }
.day-comment:empty { display: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 10px; }
.gallery img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 16px; border: 1px solid var(--card-border); cursor: pointer;
}

/* ===================== Bottom Nav ===================== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8, 12, 17, 0.78);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--card-border);
  display: flex; z-index: 40;
}
.tab {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; color: var(--muted); font-weight: 700; font-size: 0.7rem; padding: 8px 0;
}
.tab-svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; transition: 0.2s; }
.tab.active { color: var(--text); }
.tab.active .tab-svg { stroke: var(--cyan); filter: drop-shadow(0 0 6px rgba(47,211,255,0.6)); }

/* ===================== Modals ===================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(3, 6, 10, 0.65);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
}
.modal.center { align-items: center; padding: 24px; }
.modal[hidden] { display: none; }

.modal-card {
  background: #0e141c; border: 1px solid var(--card-border);
  width: 100%; max-width: 520px;
  border-radius: 28px 28px 0 0;
  padding: 26px 22px calc(env(safe-area-inset-bottom) + 26px);
}
.modal-card h2 { margin-top: 0; }
.modal-card label {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px;
  font-weight: 600; font-size: 0.95rem; color: #c4cdda;
}
.modal-card input {
  padding: 15px; font-size: 1.05rem; color: var(--text);
  border: 1px solid var(--card-border); border-radius: 14px; background: rgba(255,255,255,0.04);
}
.modal-card input:focus { outline: none; border-color: var(--cyan); }
.modal-actions { display: flex; gap: 12px; margin-top: 8px; }

.success-card {
  background: #0e141c; border: 1px solid var(--card-border);
  border-radius: 28px; padding: 36px 26px 26px; text-align: center;
  max-width: 360px; width: 100%;
  box-shadow: 0 0 60px rgba(47, 211, 255, 0.2);
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-card h2 { margin: 18px 0 8px; font-size: 1.4rem; }
.success-card p { margin: 0 0 22px; color: var(--muted); line-height: 1.45; white-space: pre-line; }
.success-thumb {
  width: 110px; height: 110px; object-fit: cover;
  border-radius: 18px; margin: 0 auto 6px; display: block;
  border: 2px solid var(--card-border);
  box-shadow: 0 8px 22px rgba(0,0,0,0.4);
}
.success-thumb[hidden] { display: none; }
.success-card .primary-btn { width: 100%; }
.check-circle {
  width: 84px; height: 84px; margin: 0 auto; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 0 30px rgba(47, 211, 255, 0.5);
}
.check-svg { width: 46px; height: 46px; }
.check-path {
  stroke: #04121b; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw 0.5s 0.15s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.photo-viewer { text-align: center; max-width: 92vw; }
.photo-viewer img {
  max-width: 100%; max-height: 70vh; border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6); margin-bottom: 16px;
}
.photo-viewer .primary-btn { width: 100%; max-width: 280px; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  left: 50%; transform: translateX(-50%);
  background: #161d27; border: 1px solid var(--card-border); color: var(--text);
  padding: 14px 22px; border-radius: 24px; font-weight: 600; z-index: 100;
  box-shadow: 0 10px 28px rgba(0,0,0,0.5); max-width: 90%; text-align: center;
}
.toast[hidden] { display: none; }

/* ===================== Hydro Pact ===================== */
.pact-card { padding: 18px 20px; margin-bottom: 20px; }
.pact-head { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.pact-state[hidden] { display: none; }
.pact-info { color: var(--muted); font-size: 0.9rem; line-height: 1.45; margin: 0 0 14px; }
.pact-card .custom-add { margin-top: 10px; }
.pact-card .custom-add input { text-transform: uppercase; letter-spacing: 2px; text-align: center; font-weight: 700; }
.pact-code {
  font-size: 2rem; font-weight: 800; letter-spacing: 8px; text-align: center;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin: 6px 0 14px;
}
.pact-shared {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(135deg, rgba(47,211,255,0.12), rgba(123,108,240,0.12));
  border: 1px solid rgba(47,211,255,0.25); border-radius: 18px; padding: 16px; margin-bottom: 14px;
}
.pact-shared-num {
  font-size: 2rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pact-shared-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.pact-today { display: flex; gap: 12px; margin-bottom: 14px; }
.pact-person {
  flex: 1; background: rgba(255,255,255,0.05); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 14px 8px; text-align: center; font-weight: 700; font-size: 0.95rem;
}
.pact-person span { font-size: 1.3rem; display: block; margin-bottom: 4px; }

/* ===================== Onboarding ===================== */
.onboarding {
  position: fixed; inset: 0; z-index: 200;
  background:
    radial-gradient(90% 55% at 50% -8%, rgba(120,230,255,0.28) 0%, rgba(60,140,230,0.14) 28%, transparent 58%),
    linear-gradient(180deg, #06101f 0%, #04070f 60%, #02040a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  padding-top: max(env(safe-area-inset-top), 24px);
  padding-bottom: max(env(safe-area-inset-bottom), 24px);
}
.onboarding[hidden] { display: none; }
.ob-card {
  width: 100%; max-width: 440px;
  background: rgba(255,255,255,0.045); border: 1px solid var(--card-border);
  border-radius: 28px; padding: 28px 24px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.ob-step { display: none; animation: fadeIn 0.3s ease; text-align: center; min-height: 230px; }
.ob-step.active { display: block; }
.ob-emoji { font-size: 3.4rem; margin-bottom: 8px; }
.ob-step h2 { font-size: 1.5rem; margin: 0 0 10px; }
.ob-step p { color: #c4cdda; line-height: 1.5; margin: 0 0 14px; }
.ob-hint { font-size: 0.82rem; color: var(--muted); }
.ob-step label {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  font-weight: 600; font-size: 0.9rem; color: #c4cdda; margin-bottom: 16px;
}
.ob-step label input {
  padding: 15px; font-size: 1.05rem; color: var(--text);
  border: 1px solid var(--card-border); border-radius: 14px; background: rgba(255,255,255,0.04);
}
.ob-step label input:focus { outline: none; border-color: var(--cyan); }
.ob-goals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 8px; }
.ob-goals button {
  background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); color: var(--text);
  border-radius: 16px; padding: 18px; font-size: 1.1rem; font-weight: 800; cursor: pointer;
}
.ob-goals button.sel { background: var(--grad); color: #04121b; border-color: transparent; }
#obEnableNotif { width: 100%; margin: 8px 0 14px; }
.ob-dots { display: flex; justify-content: center; gap: 8px; margin: 18px 0; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.2); }
.ob-dots i.on { background: var(--cyan); width: 22px; border-radius: 6px; }
.ob-nav { display: flex; gap: 12px; }
.ob-nav button { flex: 1; }
.ob-nav #obBack[hidden] { display: none; }
