.story-hearts { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.story-heart { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 12px; border: 0; background: transparent; color: #f1ca86; cursor: pointer; pointer-events: auto; transform: translate(-50%, -50%); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.story-heart > svg { pointer-events: none; }
.story-heart svg { --heart-rest-opacity: .26; --heart-rest-fill: currentColor; --heart-wink-fill: currentColor; width: 21px; height: 21px; fill: currentColor; stroke: none; opacity: .26; filter: drop-shadow(0 1px 2px #331b16); transition: opacity .3s, filter .3s; }
.story-heart-1 { left: 9%; top: 29%; }
.story-heart-2 { left: 88%; top: 32%; }
.story-heart-3 { left: 13%; top: 69%; }
.story-heart-4 { left: 84%; top: 75%; }
.story-heart-5 { left: 66%; top: 88%; }
@media (prefers-reduced-motion: no-preference) {
  .story-heart:not(.found) svg { animation: storyHeartPeek 9s ease-in-out infinite; animation-delay: var(--heart-delay); }
  @keyframes storyHeartPeek {
    0%, 62%, 90%, 100% { opacity: var(--heart-rest-opacity); transform: scale(.96); fill: var(--heart-rest-fill); }
    70% { opacity: .95; transform: scale(1.12); fill: var(--heart-wink-fill); filter: drop-shadow(0 0 5px #e9bd7280); }
    75% { opacity: .4; transform: scale(.94); fill: var(--heart-rest-fill); }
    81% { opacity: .9; transform: scale(1.06); fill: var(--heart-wink-fill); filter: drop-shadow(0 0 4px #e9bd7266); }
  }
}
.story-heart.found svg, .story-heart:focus-visible svg { animation: none; opacity: 1; filter: drop-shadow(0 0 6px #e9bd7299); }
@media (hover: hover) {
  .story-heart:hover svg { animation: none; opacity: 1; filter: drop-shadow(0 0 6px #e9bd7299); }
}
.story-heart:focus-visible { outline: 1px solid #f1ca86; outline-offset: 0; border-radius: 50%; }
.story-heart::before { content: ''; position: absolute; inset: 7px; border: 0; border-radius: 50%; background: radial-gradient(circle, #edc47a24, transparent 72%); box-shadow: 0 0 12px 4px #e9bd7240, inset 0 0 8px #e9bd7226; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.needs-attention .story-heart:not(.found)::before { opacity: .7; }
.needs-attention .story-heart:not(.found) svg { --heart-rest-opacity: .65; opacity: .8; filter: drop-shadow(0 0 7px #e9bd7299); }
@media (prefers-reduced-motion: no-preference) {
  .needs-attention .story-heart:not(.found)::before { animation: remainingHeartHalo 4.5s ease-in-out infinite; animation-delay: var(--heart-delay); }
  @keyframes remainingHeartHalo { 0%, 100% { transform: scale(.95); } 50% { transform: scale(1.18); } }
}
.story-subtitle { position: absolute; left: 50%; bottom: 66px; width: min(580px, calc(100% - 48px)); transform: translateX(-50%); opacity: 0; transition: opacity .9s ease; pointer-events: none; text-align: center; color: #f4d7a1; text-shadow: 0 2px 4px #1d110c, 0 0 9px #1d110ce6; }
.story-subtitle.visible { opacity: 1; transition-duration: .18s; }
.story-subtitle p { margin: 0; font: 500 20px/1.45 'Cormorant Garamond', Georgia, serif; }
.story-subtitle .story-subtitle-invitation { margin-top: 10px; font-style: italic; font-size: 18px; }
.story-idle-hint { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; z-index: 18; width: min(430px, calc(100% - 48px)); transform: translateX(-50%); color: #f4d7a1; text-align: center; text-shadow: 0 1px 3px #1d110c, 0 0 7px #1d110c; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility .9s; }
.story-idle-hint.visible { opacity: 1; visibility: visible; }
.story-idle-hint.over-picture { bottom: 66px; }
.story-idle-hint p { margin: 0; font: italic 17px/1.4 'Cormorant Garamond', Georgia, serif; }
.story-idle-hint button { min-height: 44px; padding: 8px 12px; border: 0; color: inherit; background: transparent; font: italic 15px 'Cormorant Garamond', Georgia, serif; text-decoration: underline; text-underline-offset: 4px; pointer-events: auto; cursor: pointer; }
.story-idle-hint button[hidden] { display: none; }
.story-counter { position: absolute; bottom: 18px; right: 22px; color: #f3d59f; text-align: center; text-shadow: 0 1px 4px #21120e; }
.story-counter[hidden], .story-read[hidden] { display: none; }
.story-tally { display: flex; align-items: center; gap: 4px; }
.story-tally svg { display: block; width: 10px; height: 10px; fill: transparent; stroke: currentColor; stroke-width: 1.2; }
.story-tally .filled svg { fill: currentColor; }
.story-tally small { margin-left: 3px; font: 9px/1 'Manrope', sans-serif; letter-spacing: .04em; }
.story-read { display: block; min-height: 40px; padding: 8px 15px; margin: 7px 0 0; border: 1px solid #e9bd7290; border-radius: 999px; color: #fff0d3; background: #291712b8; box-shadow: 0 5px 18px #14080655; font: 600 11px 'Manrope', sans-serif; letter-spacing: .06em; pointer-events: auto; cursor: pointer; }
.story-read:hover { background: #42221bd9; border-color: #f1ca86; }
.story-celebration { position: absolute; left: 50%; top: 50%; z-index: 9; width: min(320px, calc(100% - 48px)); transform: translate(-50%, -50%); color: #ffe1a3; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; }
.story-celebration p { margin: 0; font: italic 22px/1.3 'Cormorant Garamond', Georgia, serif; text-shadow: 0 2px 8px #24100d, 0 0 18px #e9bd7277; }
.story-celebration-burst { position: absolute; left: 50%; top: 50%; width: 1px; height: 1px; }
.story-celebration-burst i { position: absolute; width: 7px; height: 7px; background: #f1ca86; transform: rotate(45deg); opacity: 0; }
.story-celebration-burst i:nth-child(1) { --burst-x: -118px; --burst-y: -52px; }
.story-celebration-burst i:nth-child(2) { --burst-x: -80px; --burst-y: -100px; }
.story-celebration-burst i:nth-child(3) { --burst-x: -30px; --burst-y: -122px; }
.story-celebration-burst i:nth-child(4) { --burst-x: 30px; --burst-y: -116px; }
.story-celebration-burst i:nth-child(5) { --burst-x: 94px; --burst-y: -76px; }
.story-celebration-burst i:nth-child(6) { --burst-x: 116px; --burst-y: 4px; }
.story-celebration-burst i:nth-child(7) { --burst-x: 74px; --burst-y: 76px; }
.story-celebration-burst i:nth-child(8) { --burst-x: 8px; --burst-y: 104px; }
.story-celebration-burst i:nth-child(9) { --burst-x: -68px; --burst-y: 82px; }
.story-celebration-burst i:nth-child(10) { --burst-x: -112px; --burst-y: 28px; }
@media (prefers-reduced-motion: no-preference) {
  .story-celebration.celebrating { visibility: visible; animation: celebrationMessage 3.1s ease both; }
  .story-celebration.celebrating::before { content: ''; position: absolute; inset: -80px -30px; border-radius: 50%; background: radial-gradient(circle, #e9bd723d, transparent 68%); animation: celebrationGlow 2.4s ease-out both; }
  .story-celebration.celebrating .story-celebration-burst i { animation: celebrationSpark 1.8s ease-out both; animation-delay: calc((var(--burst-order, 0)) * 45ms); }
  @keyframes celebrationMessage { 0% { opacity: 0; transform: translate(-50%, -46%) scale(.96); } 18%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -54%) scale(1); } }
  @keyframes celebrationGlow { from { opacity: 0; transform: scale(.45); } 28% { opacity: 1; } to { opacity: 0; transform: scale(1.15); } }
  @keyframes celebrationSpark { 0% { opacity: 0; transform: translate(0,0) rotate(45deg) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--burst-x),var(--burst-y)) rotate(135deg) scale(.8); } }
}
html.heart-story-open, .heart-story-open body { overflow: hidden; }
.heart-story-dialog { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none; padding: 70px 24px; border: 0; border-radius: 0; color: #f1d5a4; background: transparent; box-shadow: none; text-align: center; text-shadow: 0 2px 8px #21120f88; }
.heart-story-dialog[open] { display: grid; place-items: center; }
.heart-story-dialog::backdrop { background: #1e120c66; backdrop-filter: blur(14px) brightness(.68); -webkit-backdrop-filter: blur(14px) brightness(.68); }
.heart-story-scroll { width: min(490px, 100%); max-height: calc(100svh - 140px); overflow-y: auto; padding: 0 18px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d3ad7080 transparent; }
.heart-story-close { position: absolute; top: max(18px, env(safe-area-inset-top)); right: 20px; width: 44px; height: 44px; border: 0; color: #dfbe87; background: transparent; font: 26px Georgia, serif; cursor: pointer; }
.heart-story-kicker { margin: 0 20px 18px; font: 9px/1.5 'Manrope',sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #c6a878; }
.heart-story-dialog h2 { margin: 0 0 18px; font: 500 30px/1.15 'Cormorant Garamond',Georgia,serif; }
.heart-story-sketch { margin: 0 auto 26px; }
.heart-story-sketch img { display: block; width: min(360px, 100%); margin: 0 auto; border: 1px solid #e5c79066; border-radius: 3px; box-shadow: 0 14px 38px #160a0766; }
.heart-story-sketch figcaption { margin-top: 9px; color: #d2b887; font: italic 14px/1.4 'Cormorant Garamond',Georgia,serif; }
.heart-story-copy p { margin: 0 0 18px; font: 22px/1.5 'Cormorant Garamond',Georgia,serif; }
.heart-story-copy .heart-story-invitation { margin-top: 24px; padding-top: 20px; border-top: 1px solid #d3ad7044; font-style: italic; color: #ffe0a6; }
.heart-story-dialog [hidden] { display: none; }
.heart-story-dialog :focus-visible { outline: 1px solid #e9bd72; outline-offset: 3px; }
@media (max-width: 680px) {
  .story-idle-hint.over-picture { bottom: max(86px, calc(env(safe-area-inset-bottom) + 86px)); width: calc(100% - 80px); }
  .story-idle-hint.over-picture p { font-size: 14px; line-height: 1.3; }
  .story-heart svg { --heart-rest-opacity: .36; width: 16px; height: 16px; fill: currentColor; stroke: none; opacity: .36; filter: drop-shadow(0 0 3px #e9bd7255); }
  .story-heart.found svg { fill: currentColor; opacity: 1; filter: drop-shadow(0 0 3px #e9bd7255); }
  .story-heart::before { inset: 9px; border: 0; box-shadow: 0 0 12px 3px #e9bd7233; }
  .needs-attention .story-heart:not(.found) svg { opacity: .9; filter: drop-shadow(0 0 5px #e9bd7270); }
  .story-heart-1 { left: 81%; top: 44%; }
  .story-heart-2 { left: 70%; top: 52%; }
  .story-heart-3 { left: 28%; top: 35%; }
  .story-heart-4 { left: 91%; top: 59%; }
  .story-heart-5 { left: 22%; top: 81%; }
  .story-subtitle { bottom: 100px; width: calc(100% - 48px); }
  .story-subtitle p { font-size: 18px; line-height: 1.4; }
  .story-subtitle .story-subtitle-invitation { font-size: 16px; }
  .story-counter { position: absolute; inset: 0; transform: none; pointer-events: none; }
  .story-counter:not(.has-progress) { display: none; }
  .story-counter.has-progress { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility .45s; }
  .story-counter.has-progress.controls-visible { opacity: 1; visibility: visible; }
  .story-tally { position: absolute; left: 16px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 28px)); min-height: 40px; justify-content: center; padding: 0 9px; border-radius: 999px; background: #2917128f; }
  .story-read { position: absolute; right: 16px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 28px)); min-width: 128px; min-height: 40px; margin: 0; padding: 7px 11px; font-size: 10px; pointer-events: auto; }
  .heart-story-dialog { padding: 70px 20px; }
  .heart-story-scroll { padding: 0 12px; }
  .heart-story-copy p { font-size: 20px; line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) {
  .story-subtitle, .story-idle-hint, .story-counter.has-progress { transition: none; }
  .story-celebration.celebrating { visibility: visible; opacity: 1; }
  .story-celebration.celebrating .story-celebration-burst { display: none; }
}
