/* =====================================================================
   Haushalt, Goldmünzen & Belohnungs-Effekte
   ===================================================================== */

/* ---------------------------------------------------------------- Münzzähler in der Seitenleiste */
.coin-badge {
  display: flex; flex-direction: column; align-items: center; gap: 1px; width: 58px; padding: 8px 0 7px; margin: 6px 0;
  border-radius: 12px; text-decoration: none !important; color: #fbbf24 !important;
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.06)); border: 1px solid rgba(251, 191, 36, 0.3);
}
.coin-badge:hover { background: linear-gradient(160deg, rgba(251, 191, 36, 0.28), rgba(245, 158, 11, 0.1)); }
.cb-coin { font-size: 1.2rem; animation: coin-spin 6s ease-in-out infinite; display: inline-block; }
.cb-num { font-size: 0.78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.coin-badge.bump, .pt-hero.bump { animation: bump-gold 0.7s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes bump-gold { 40% { transform: scale(1.15); filter: brightness(1.4); } }
@keyframes coin-spin { 0%, 80%, 100% { transform: rotateY(0); } 90% { transform: rotateY(180deg); } }
@media (max-width: 760px) { .coin-badge { display: none; } }

/* ---------------------------------------------------------------- Effekte */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.fx-amount {
  position: absolute; transform: translate(-50%, -50%); font-size: 2rem; font-weight: 900; color: #fbbf24; white-space: nowrap;
  text-shadow: 0 2px 0 #b45309, 0 6px 20px rgba(0, 0, 0, 0.45); animation: fx-rise 1.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.fx-amount.neg { color: #fca5a5; text-shadow: 0 2px 0 #7f1d1d, 0 6px 20px rgba(0, 0, 0, 0.45); }
@keyframes fx-rise { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); } 15% { opacity: 1; transform: translate(-50%, -80%) scale(1.25); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
.fx-coin { position: absolute; font-size: 1.4rem; animation: fx-coin 1.3s cubic-bezier(0.2, 0.7, 0.4, 1) forwards; }
@keyframes fx-coin {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  15% { opacity: 1; }
  45% { transform: translate(calc(-50% + var(--dx) * 0.7), calc(-50% + var(--dy))) rotate(calc(var(--rot) * 0.5)) scale(1.1); }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 260px)) rotate(var(--rot)) scale(0.8); opacity: 0; }
}
.fx-banner {
  position: absolute; left: 50%; top: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 16px;
  min-width: min(440px, 92vw); padding: 16px 22px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #1e293b, #0f172a); border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); animation: fx-banner-in 0.6s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.fx-banner.gold { background: linear-gradient(135deg, #b45309, #f59e0b 60%, #fcd34d); color: #1c1003; }
.fx-banner.rank { background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.fx-banner.green { background: linear-gradient(135deg, #047857, #10b981); }
.fx-banner.out { animation: fx-banner-out 0.5s ease-in forwards; }
.fx-b-emoji { font-size: 2.6rem; animation: wiggle 1s ease-in-out 2; }
.fx-b-title { font-weight: 850; font-size: 1.05rem; }
.fx-b-text { font-size: 0.88rem; opacity: 0.9; }
@keyframes fx-banner-in { from { transform: translate(-50%, -140%); opacity: 0; } }
@keyframes fx-banner-out { to { transform: translate(-50%, -140%); opacity: 0; } }
@keyframes wiggle { 25% { transform: rotate(-14deg) scale(1.1); } 75% { transform: rotate(14deg) scale(1.1); } }

/* ---------------------------------------------------------------- Haushalt-Seite */
.hh-hero { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.glass-gold {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px 26px; display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, #78350f 0%, #b45309 40%, #f59e0b 80%, #fcd34d 100%); color: #fff; box-shadow: 0 14px 40px rgba(180, 83, 9, 0.35);
}
.glass-gold::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  background-size: 250% 100%; animation: gold-sheen 5s ease-in-out infinite;
}
@keyframes gold-sheen { 0%, 60% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
.pt-coin { font-size: 4.2rem; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3)); animation: coin-float 3s ease-in-out infinite; }
@keyframes coin-float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
.pt-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; }
.pt-num { font-size: clamp(3rem, 6vw, 4.8rem); font-weight: 900; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 rgba(120, 53, 15, 0.6); }
.pt-sub { font-size: 0.85rem; opacity: 0.85; margin-top: 4px; }
.hh-rank, .hh-today { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.rank-emoji { font-size: 3rem; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 1.4rem; font-weight: 800; margin: 2px 0 8px; }
.rank-bar { height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--muted) 25%, transparent); overflow: hidden; margin-bottom: 6px; }
.rank-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #f59e0b, #fcd34d); box-shadow: 0 0 12px rgba(251, 191, 36, 0.6); transition: width 1s ease; }
.goal-ring {
  --p: 0; width: 92px; height: 92px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--success) calc(var(--p) * 1%), color-mix(in srgb, var(--muted) 22%, transparent) 0);
}
.goal-ring > div { width: 74px; height: 74px; border-radius: 50%; background: var(--card-solid); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.goal-ring b { font-size: 1.4rem; }
.goal-ring small { color: var(--muted); font-size: 0.72rem; }
.streak { font-size: 1.05rem; margin: 4px 0 2px; }
.streak b { font-size: 1.5rem; }
.flame { display: inline-block; filter: grayscale(1); opacity: 0.4; }
.flame.on { filter: none; opacity: 1; animation: flicker 1.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.15) rotate(3deg); } }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 8px; }
.mini-bars span { flex: 1; min-width: 4px; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--muted) 40%, transparent); }
.mini-bars span.hit { background: var(--success); }

.hh-sec { padding: 18px 20px; margin-bottom: 18px; }
.hh-sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.hh-sec-head h2 { font-size: 1.15rem; }
.hh-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hh-two .hh-sec { margin-bottom: 18px; }
.hh-label { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.hh-label.due { color: var(--danger); }
.hh-chores .chore-grid + .hh-label { margin-top: 18px; }

/* Hausarbeits-Kacheln */
.chore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.chore {
  position: relative; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--border); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.chore:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.chore-main { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 10px; border: 0; background: none; color: var(--text); cursor: pointer; text-align: center; }
.chore-emoji { font-size: 2rem; line-height: 1.1; transition: transform 0.2s; }
.chore:hover .chore-emoji { transform: scale(1.12) rotate(-6deg); }
.chore-name { font-weight: 650; font-size: 0.9rem; line-height: 1.2; }
.chore-status { font-size: 0.72rem; color: var(--muted); }
.chore.ok .chore-status { color: var(--success); }
.chore-done {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px; border: 0; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--success) 10%, transparent); color: var(--success); font-weight: 750; font-size: 0.82rem; cursor: pointer;
}
.chore-done:hover { background: var(--success); color: #fff; }
.chore.due, .chore.over { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 9%, var(--bg-2)); }
.chore.due .chore-status { color: var(--warn); font-weight: 700; }
.chore.over { border-color: color-mix(in srgb, var(--danger) 60%, transparent); background: color-mix(in srgb, var(--danger) 9%, var(--bg-2)); animation: chore-nag 2.6s ease-in-out infinite; }
.chore.over .chore-status { color: var(--danger); font-weight: 700; }
.chore.over .chore-emoji, .chore.due .chore-emoji { animation: wiggle 1.2s ease-in-out infinite; animation-delay: 1s; }
@keyframes chore-nag { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 30%, transparent); } }

/* Belohnungen */
.hh-shop { display: flex; flex-direction: column; gap: 8px; }
.reward { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); }
.reward.can { border-color: color-mix(in srgb, #f59e0b 50%, transparent); background: color-mix(in srgb, #f59e0b 8%, var(--bg-2)); }
.rw-emoji { font-size: 1.8rem; }
.rw-main { flex: 1; min-width: 0; }
.rw-title { font-weight: 650; }
.rw-bar { height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--muted) 22%, transparent); overflow: hidden; margin: 5px 0 3px; }
.rw-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.reward .btn { min-width: 74px; }

/* Erfolge */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ach { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 12px 6px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); opacity: 0.5; filter: grayscale(0.8); }
.ach.on { opacity: 1; filter: none; border-color: color-mix(in srgb, #f59e0b 45%, transparent); background: linear-gradient(160deg, color-mix(in srgb, #f59e0b 14%, var(--bg-2)), var(--bg-2)); }
.ach-emoji { font-size: 1.8rem; }
.ach-name { font-weight: 700; font-size: 0.8rem; }
.ach-desc { font-size: 0.68rem; color: var(--muted); }

/* Logbuch */
.hh-hist { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.hist-pts { min-width: 52px; font-weight: 800; color: var(--success); font-variant-numeric: tabular-nums; }
.hist-pts.neg { color: var(--danger); }
.hist-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-bonus { width: 24px; text-align: center; }

@media (max-width: 1100px) { .hh-hero { grid-template-columns: 1fr 1fr; } .glass-gold { grid-column: 1 / -1; } .hh-two { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .hh-hero { grid-template-columns: 1fr; }
  .chore-grid { grid-template-columns: repeat(2, 1fr); }
  .pt-coin { font-size: 3rem; }
}

/* ---------------------------------------------------------------- Startseite: Schatztruhe */
a.w-points {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 14px; text-decoration: none !important;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.55), rgba(245, 158, 11, 0.35) 60%, rgba(252, 211, 77, 0.25));
  border-color: rgba(252, 211, 77, 0.35); transition: transform 0.15s;
}
a.w-points:hover { transform: translateY(-2px); }
.wp-top { display: flex; align-items: center; gap: 14px; }
.wp-coin { font-size: 3rem; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); animation: coin-float 3s ease-in-out infinite; }
.wp-main { flex: 1; min-width: 0; }
.wp-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 243, 214, 0.85); }
.wp-num { font-size: clamp(2.6rem, 3.6vw, 3.6rem); font-weight: 900; line-height: 1; letter-spacing: -0.03em; color: #fff; text-shadow: 0 3px 0 rgba(120, 53, 15, 0.7), 0 8px 24px rgba(0, 0, 0, 0.3); font-variant-numeric: tabular-nums; }
.wp-ring {
  --p: 0; width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(#4ade80 calc(var(--p) * 1%), rgba(255, 255, 255, 0.18) 0);
}
.wp-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: rgba(60, 30, 6, 0.75); }
.wp-ring span { position: relative; font-size: 0.74rem; font-weight: 800; }
.wp-rank { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.9rem; }
.wp-streak { font-size: 0.85rem; }
.w-points .rank-bar { margin: 0; height: 6px; background: rgba(255, 255, 255, 0.18); }
.wp-next { display: flex; justify-content: space-between; gap: 8px; font-size: 0.74rem; color: rgba(255, 243, 214, 0.85); }

/* Startseite: Haushalt-Kachel (dunkle Glasoptik) */
.w-chores { flex: 1 1 0; }
.chore-grid.mini { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
main.view-home .chore { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.08); border-radius: 14px; }
main.view-home .chore:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
main.view-home .chore.due { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.5); }
main.view-home .chore.over { background: rgba(239, 68, 68, 0.16); border-color: rgba(248, 113, 113, 0.6); --danger: #ff7a80; }
main.view-home .chore.due .chore-status { color: #fbbf24; }
main.view-home .chore.ok .chore-status { color: #4ade80; }
.chore-grid.mini .chore-main { padding: 10px 4px 6px; gap: 2px; }
.chore-grid.mini .chore-emoji { font-size: 1.6rem; }
.chore-grid.mini .chore-name { font-size: 0.78rem; }
.chore-grid.mini .chore-status { font-size: 0.64rem; }
.chore-grid.mini .chore-done { padding: 5px; font-size: 0.74rem; background: rgba(74, 222, 128, 0.12); color: #4ade80; border-top-color: rgba(255, 255, 255, 0.06); }
.chore-grid.mini .chore-done:hover { background: #22c55e; color: #fff; }
.sec-chore { color: #fbbf24; }
.chore-pts { font-size: 0.75rem; font-weight: 800; color: #fbbf24; white-space: nowrap; }
@media (max-width: 760px) {
  a.w-points { order: -1; }
  .w-chores { order: 1; max-height: 460px; }
}
@media (prefers-reduced-motion: reduce) {
  .cb-coin, .pt-coin, .wp-coin, .flame.on, .chore.over, .chore-emoji, .glass-gold::after { animation: none !important; }
}
