/* Hartvig at four personal moments (hartvig-greetings.mjs): the editor tour,
   hello in a new language, the Hearts jar after a purchase and the account's
   birthday. No sound; reduced motion is still.
   !important on buttons: the app clears every button's look. */
.hartvig-g-figure { display: block; }
.hartvig-g-figure svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* 1. The editor tour: a ring around one thing, the card beside it, and
   Hartvig hanging on his rope from the top of the screen. */
.hartvig-tour { position: fixed; inset: 0; z-index: 2147482000; pointer-events: none; animation: hartvig-g-fade .25s ease; }
.hartvig-tour.is-leaving { opacity: 0; transition: opacity .25s ease; }
.hartvig-tour-ring {
  position: fixed; border: 2px solid #f04491; border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(8,6,12,.58), 0 0 0 6px rgba(240,68,145,.18), 0 0 28px rgba(240,68,145,.45);
  transition: left .55s cubic-bezier(.4,1.2,.5,1), top .55s cubic-bezier(.4,1.2,.5,1), width .55s cubic-bezier(.4,1.2,.5,1), height .55s cubic-bezier(.4,1.2,.5,1);
}
.hartvig-tour-rope { position: fixed; top: 0; transition: left .7s cubic-bezier(.4,1.3,.5,1), height .7s cubic-bezier(.4,1.3,.5,1); }
.hartvig-tour-rope::before { display: none; }
.hartvig-tour-figure { position: fixed; filter: drop-shadow(0 10px 16px rgba(0,0,0,.4)); transform-origin: 82.5% 22%; transition: left .7s cubic-bezier(.4,1.3,.5,1), top .7s cubic-bezier(.4,1.3,.5,1); animation: hartvig-g-sway 3.2s ease-in-out infinite; }
.hartvig-tour-card {
  position: fixed; width: min(300px, calc(100vw - 32px)); display: grid; gap: 6px; padding: 16px 16px 12px;
  border: 1px solid rgba(240,68,145,.5); border-radius: 16px; background: #1d1724; color: #f7f4fa;
  box-shadow: 0 18px 44px rgba(0,0,0,.5); pointer-events: auto; text-align: start;
  transition: left .55s cubic-bezier(.4,1.2,.5,1), top .55s cubic-bezier(.4,1.2,.5,1);
}
.hartvig-tour-title { font-size: 15.5px; line-height: 1.3; }
.hartvig-tour-text { margin: 0; color: #cfc6d8; font-size: 13px; line-height: 1.5; }
.hartvig-tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hartvig-tour-dots { display: flex; gap: 5px; }
.hartvig-tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.22); transition: background .25s, transform .25s; }
.hartvig-tour-dots i.is-on { background: #f04491; transform: scale(1.15); }
.hartvig-tour-count { margin-inline-end: auto; color: #a99fb3; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.hartvig-tour-card button { min-height: 32px; padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.hartvig-tour-card .hartvig-tour-skip { border: 0 !important; background: transparent !important; color: #cfc6d8 !important; padding-inline: 8px; }
.hartvig-tour-card .hartvig-tour-next { border: 0 !important; background: linear-gradient(90deg, #f04491, #b14cff) !important; color: #fff !important; box-shadow: 0 6px 16px rgba(240,68,145,.3); }
.hartvig-tour-card button:hover { filter: brightness(1.1); }
.hartvig-tour-card button:focus-visible { outline: 2px solid #ff8cc0; outline-offset: 2px; }
html[data-theme="light"] .hartvig-tour-ring { box-shadow: 0 0 0 9999px rgba(30,16,36,.42), 0 0 0 6px rgba(240,68,145,.18), 0 0 24px rgba(240,68,145,.35); }
html[data-theme="light"] .hartvig-tour-card { background: #fff; color: #1e1424; box-shadow: 0 18px 40px rgba(60,20,60,.22); }
html[data-theme="light"] .hartvig-tour-text { color: #5d5066; }
html[data-theme="light"] .hartvig-tour-count { color: #7a6c84; }
html[data-theme="light"] .hartvig-tour-dots i { background: rgba(42,23,48,.18); }
html[data-theme="light"] .hartvig-tour-card .hartvig-tour-skip { color: #5d5066 !important; }
@keyframes hartvig-g-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes hartvig-g-fade { from { opacity: 0; } to { opacity: 1; } }

/* 4. Hello in a new language, by the language button. */
.hartvig-langhello { position: fixed; z-index: 2147483000; width: 300px; height: 128px; pointer-events: none; animation: hartvig-g-pop .4s cubic-bezier(.3,1.5,.5,1); transform-origin: 85% 0; }
.hartvig-langhello.is-leaving { opacity: 0; transform: translateY(-8px); transition: opacity .35s ease, transform .35s ease; }
.hartvig-langhello-figure { position: absolute; right: 44px; top: 26px; width: 100px; height: 100px; filter: drop-shadow(0 10px 16px rgba(0,0,0,.35)); }
.hartvig-langhello .hartvig-flag { transform-box: view-box; transform-origin: 175px 57px; animation: hartvig-g-wave .6s ease-in-out infinite alternate; }
.hartvig-langhello .hartvig-flag-cloth { transform-box: view-box; transform-origin: 177px -20px; animation: hartvig-g-cloth .45s ease-in-out infinite alternate; }
.hartvig-langhello-bubble {
  position: absolute; right: 150px; top: 38px; max-width: 150px; padding: 8px 14px; border-radius: 16px 16px 4px 16px;
  background: #fff; color: #1e1424; font: 800 16px/1.2 "Inter Variable", Inter, system-ui, sans-serif; white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0,0,0,.3); animation: hartvig-g-pop .4s .15s cubic-bezier(.3,1.5,.5,1) both;
}
html[data-theme="light"] .hartvig-langhello-bubble { border: 1px solid rgba(240,68,145,.35); box-shadow: 0 10px 24px rgba(60,20,60,.16); }
@keyframes hartvig-g-pop { from { opacity: 0; transform: scale(.7) translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes hartvig-g-wave { from { transform: rotate(-9deg); } to { transform: rotate(7deg); } }
@keyframes hartvig-g-cloth { from { transform: skewY(-5deg) scaleX(.95); } to { transform: skewY(5deg); } }

/* 6. Back from buying Hearts. */
.hartvig-hearts {
  position: fixed; z-index: 2147482500; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px; width: min(560px, calc(100vw - 32px)); padding: 16px 20px 16px 14px;
  border: 1px solid rgba(240,68,145,.45); border-radius: 22px; background: #1d1724; color: #f7f4fa;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.03) inset; text-align: start;
  animation: hartvig-g-rise .45s cubic-bezier(.3,1.4,.5,1);
}
.hartvig-hearts.is-leaving { opacity: 0; transform: translate(-50%, 16px); transition: opacity .3s ease, transform .3s ease; }
@keyframes hartvig-g-rise { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translateX(-50%); } }
.hartvig-hearts-scene { position: relative; flex: none; width: 178px; height: 140px; }
.hartvig-jar { position: absolute; left: 6px; bottom: 4px; width: 78px; height: 100px; overflow: hidden; border: 3px solid rgba(255,255,255,.75); border-top: 0; border-radius: 10px 10px 22px 22px; background: rgba(255,255,255,.06); }
.hartvig-jar-lid { position: absolute; left: -3px; right: -3px; top: 0; height: 5px; border-radius: 2px; background: rgba(255,255,255,.75); }
.hartvig-jar-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 6%; background: linear-gradient(180deg, #ff8cc0, #e0367f); transition: height 2.4s cubic-bezier(.3,.9,.4,1); }
.hartvig-jar-fill::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; height: 6px; border-radius: 50%; background: #ffb3d6; }
.hartvig-jar-shine { position: absolute; left: 9px; top: 14px; width: 6px; height: 60px; border-radius: 3px; background: rgba(255,255,255,.22); }
.hartvig-jar-label { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); color: #fff; font-size: 24px; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.hartvig-hearts-rain { position: absolute; left: 6px; top: 0; width: 78px; height: 120px; overflow: hidden; }
.hartvig-hearts-rain i { position: absolute; left: var(--x); top: -18px; color: #ff5fa6; font-style: normal; font-size: var(--s); line-height: 1; text-shadow: 0 0 6px rgba(240,68,145,.6); animation: hartvig-g-fall 1.1s var(--d) ease-in both; }
@keyframes hartvig-g-fall { from { transform: translateY(0) rotate(-10deg); opacity: 1; } 85% { opacity: 1; } to { transform: translateY(96px) rotate(12deg); opacity: 0; } }
.hartvig-hearts-figure { position: absolute; right: 0; bottom: 0; width: 96px; height: 96px; transform-origin: 50% 100%; animation: hartvig-g-cheer .7s ease-in-out 4 alternate; filter: drop-shadow(0 10px 16px rgba(240,68,145,.28)); }
@keyframes hartvig-g-cheer { from { transform: translateY(0); } to { transform: translateY(-12px) rotate(-3deg); } }
.hartvig-hearts-copy { display: grid; gap: 6px; min-width: 0; }
.hartvig-hearts-title { font-size: 19px; line-height: 1.25; letter-spacing: -.01em; }
.hartvig-hearts-text { margin: 0; color: #cfc6d8; font-size: 13px; line-height: 1.5; }
.hartvig-hearts-balance { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 0; color: #cfc6d8; font-size: 12.5px; }
.hartvig-hearts-balance[hidden] { display: none; }
.hartvig-hearts-count { color: #ff8cc0; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hartvig-hearts-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hartvig-hearts-actions button { min-height: 34px; padding: 7px 16px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.hartvig-hearts .hartvig-hearts-start { border: 0 !important; background: linear-gradient(90deg, #f04491, #b14cff) !important; color: #fff !important; box-shadow: 0 6px 16px rgba(240,68,145,.3); }
.hartvig-hearts .hartvig-hearts-close { border: 1px solid rgba(255,255,255,.18) !important; background: rgba(255,255,255,.05) !important; color: inherit !important; }
.hartvig-hearts-actions button:hover { filter: brightness(1.1); }
.hartvig-hearts-actions button:focus-visible { outline: 2px solid #ff8cc0; outline-offset: 2px; }
html[data-theme="light"] .hartvig-hearts { background: #fff; color: #1e1424; box-shadow: 0 22px 50px rgba(60,20,60,.2); }
html[data-theme="light"] .hartvig-hearts-text, html[data-theme="light"] .hartvig-hearts-balance { color: #5d5066; }
html[data-theme="light"] .hartvig-hearts-count { color: #c0306f; }
html[data-theme="light"] .hartvig-jar { border-color: rgba(42,23,48,.35); background: rgba(240,68,145,.05); }
html[data-theme="light"] .hartvig-jar-lid { background: rgba(42,23,48,.35); }
html[data-theme="light"] .hartvig-hearts .hartvig-hearts-close { border-color: rgba(42,23,48,.18) !important; background: #fff !important; }
@media (max-width: 560px) {
  .hartvig-hearts { flex-direction: column; align-items: stretch; gap: 8px; }
  .hartvig-hearts-scene { align-self: center; height: 120px; }
}

/* 10. The account's birthday on the dashboard. */
.hartvig-birthday {
  position: relative; display: flex; align-items: center; gap: 18px; width: min(680px, 100%); margin: 18px auto 4px; padding: 14px 52px 14px 16px; overflow: hidden;
  border: 1px solid rgba(240,68,145,.4); border-radius: 22px; text-align: start;
  background: radial-gradient(ellipse at 18% 0%, rgba(240,68,145,.22), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(177,76,255,.18), transparent 55%), #1d1724;
  box-shadow: 0 18px 44px rgba(0,0,0,.35); color: #f7f4fa; animation: hartvig-g-pop .45s cubic-bezier(.3,1.4,.5,1);
}
.hartvig-birthday.is-leaving { opacity: 0; transform: scale(.97); transition: opacity .3s ease, transform .3s ease; }
.hartvig-birthday-scene { position: relative; flex: none; width: 196px; height: 118px; }
.hartvig-cake { position: absolute; left: 4px; bottom: 6px; width: 84px; height: 80px; }
.hartvig-cake-plate { position: absolute; left: -10px; right: -10px; bottom: 0; height: 7px; border-radius: 4px; background: #e2d6ea; }
.hartvig-cake-body { position: absolute; left: 0; right: 0; bottom: 6px; height: 42px; border-radius: 6px 6px 4px 4px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 4px, transparent 4px 14px), linear-gradient(180deg, #fbcfe8, #f472b6); }
.hartvig-cake-icing { position: absolute; left: -3px; right: -3px; bottom: 42px; height: 12px; border-radius: 8px; background: #fff; }
.hartvig-cake-icing::after { content: ''; position: absolute; left: 10px; right: 10px; top: 8px; height: 9px; background: radial-gradient(circle at 6px 0, #fff 5px, transparent 5.5px) 0 0 / 16px 9px repeat-x; }
.hartvig-candle { position: absolute; left: 38px; bottom: 53px; width: 8px; height: 22px; border-radius: 2px; background: repeating-linear-gradient(180deg, #60a5fa 0 5px, #fff 5px 10px); }
.hartvig-candle i { position: absolute; left: -3px; top: -15px; width: 14px; height: 16px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff7ae, #f59e0b); box-shadow: 0 0 14px rgba(253,224,71,.8); transform-origin: 50% 100%; animation: hartvig-g-flame .2s ease-in-out infinite alternate; }
@keyframes hartvig-g-flame { from { transform: scale(.92) rotate(-4deg); } to { transform: scale(1.06) rotate(4deg); } }
.hartvig-birthday-figure { position: absolute; right: 0; bottom: 0; width: 104px; height: 104px; filter: drop-shadow(0 10px 16px rgba(240,68,145,.28)); }
.hartvig-birthday-copy { position: relative; z-index: 1; display: grid; gap: 6px; min-width: 0; }
.hartvig-birthday-scene, .hartvig-birthday .hartvig-birthday-close { z-index: 1; }
.hartvig-birthday-title { font-size: 20px; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.hartvig-birthday-text { margin: 0; color: #cfc6d8; font-size: 13.5px; line-height: 1.5; }
.hartvig-birthday .hartvig-birthday-close {
  position: absolute; top: 10px; inset-inline-end: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16) !important; background: rgba(255,255,255,.05) !important; color: #cfc6d8 !important; font-size: 13px; cursor: pointer;
}
.hartvig-birthday .hartvig-birthday-close:hover { color: #fff !important; background: rgba(255,255,255,.1) !important; }
.hartvig-birthday .hartvig-birthday-close:focus-visible { outline: 2px solid #ff8cc0; outline-offset: 2px; }
.hartvig-confetti { position: absolute; inset: 0; pointer-events: none; }
.hartvig-confetti i { position: absolute; left: var(--x); top: -14px; width: 7px; height: 11px; border-radius: 2px; background: var(--c); opacity: 0; transform: rotate(var(--r)); animation: hartvig-g-confetti 3.4s var(--d) linear 2; }
@keyframes hartvig-g-confetti { 0% { opacity: 0; transform: translateY(0) rotate(var(--r)); } 8% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, 170px) rotate(calc(var(--r) + 300deg)); } }
html[data-theme="light"] .hartvig-birthday { background: radial-gradient(ellipse at 18% 0%, rgba(240,68,145,.14), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(177,76,255,.1), transparent 55%), #fff; color: #1e1424; box-shadow: 0 16px 36px rgba(60,20,60,.12); }
html[data-theme="light"] .hartvig-birthday-text { color: #5d5066; }
html[data-theme="light"] .hartvig-birthday .hartvig-birthday-close { border-color: rgba(42,23,48,.16) !important; background: #fff !important; color: #5d5066 !important; }
html[data-theme="light"] .hartvig-cake-plate { background: #d9cbe3; }
@media (max-width: 640px) {
  .hartvig-birthday { flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 16px 16px; text-align: center; }
  .hartvig-birthday-scene { align-self: center; }
}

/* Reduced motion: everything stands still and just appears. */
.hartvig-tour.is-still, .hartvig-tour.is-still *, .hartvig-langhello.is-still, .hartvig-langhello.is-still *, .hartvig-hearts.is-still, .hartvig-hearts.is-still *, .hartvig-birthday.is-still, .hartvig-birthday.is-still * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .hartvig-tour, .hartvig-tour *, .hartvig-langhello, .hartvig-langhello *, .hartvig-hearts, .hartvig-hearts *, .hartvig-birthday, .hartvig-birthday * { animation: none !important; transition: none !important; }
  .hartvig-confetti { display: none; }
}
