/* Cozy Tree: the visit worker's styles (CONTRACT.md c): the arrows beside the tree, the like number in the heart,
   the reply button on letters, the profile card's place on the story sheet */

/* ---------- #tree-actions: a full-window layer; only its buttons take presses ---------- */
#tree-actions{position:fixed;inset:0;z-index:4;pointer-events:none}
#tree-actions[hidden]{display:none}
/* js/visit.js moves each arrow beside the tree (the translate property); before the first frame they wait off-screen.
   A press shrinks the arrow around its own middle (scale). With the spot in transform, the scale also shrank the spot
   and pulled the arrow from under the pointer: every mouse press and tap was lost (check 2026-11-24, item 3-1).
   transform stays none: the .round press shrink (css/app.css) is the scale below here */
#tree-actions .nav{position:absolute;left:0;top:0;margin:0;pointer-events:auto;transform:none;translate:-200px -200px;
  transition:background-color .25s ease,color .9s ease,opacity .3s ease}
#tree-actions .nav:active{scale:.9}
#tree-actions .nav:disabled:active{scale:1}
/* the full round keeps taking the press while the arrow is shrunk (a press near its rim is not lost either) */
#tree-actions .nav::before{content:"";position:absolute;inset:0;border-radius:50%}
#tree-actions .nav:not(:disabled):active::before{scale:1.12}
#tree-actions .nav[hidden]{display:none}
/* the waiting sign (js/visit.js): a thin arc just outside the round arrow turns while its tree is on its way */
#tree-actions .nav .nav-ring{position:absolute;left:-2px;top:-2px;width:48px;height:48px;pointer-events:none;opacity:0;
  transition:opacity .12s ease;transform-origin:50% 50%}
/* set at the press itself (js/visit.js), shown at once: the press must show within 0.1 s (an 80 ms delay made it
   131 ms). A tree drawn ahead now comes one frame after the press (js/social.js arrive), so the arc shows briefly */
#tree-actions .nav.busy .nav-ring{opacity:.7;transition:opacity .1s ease-out;animation:nav-ring .9s linear infinite}
@keyframes nav-ring{to{transform:rotate(360deg)}}

/* ---------- the heart carries its number (item 8) ---------- */
.heart.has-n svg{width:18px;height:18px;margin-top:-9px}
.heart .like-n{
  position:absolute;left:0;right:0;bottom:6px;text-align:center;pointer-events:none;
  font-size:10.5px;line-height:1;letter-spacing:.02em;font-variant-numeric:tabular-nums;opacity:.86;white-space:nowrap;
}
.heart:not(.has-n) .like-n{display:none}
.heart .burst{top:calc(50% - 4px)}
/* the own tree: the number only, nothing to press */
.heart.own{cursor:default}
.heart.own:hover{background:var(--btn)}
.heart.own:active{transform:none}
.heart.own svg{opacity:.74}

/* ---------- "Write back" on a letter (item 6) ---------- */
.inbox-line{display:flex;align-items:center;gap:12px;width:100%}
.inbox-line .inbox-row{flex:1 1 auto;width:auto;min-width:0}
.inbox-acts{flex:0 0 auto;display:flex;align-items:center;padding-right:10px}
.inbox-acts .reply-btn{font-size:12px;opacity:.78;white-space:nowrap}
.inbox-acts .reply-btn:hover{opacity:1}
.sheet .reply-btn{white-space:nowrap}

/* ---------- the profile card under the story while visiting (the profile worker fills it) ---------- */
.sheet #profile-card.in-sheet{position:static;inset:auto;margin:12px 0 2px;transform:none}

@media (prefers-reduced-motion:reduce){
  #tree-actions .nav{transition:none}
  /* no turning: the arc stays still and breathes once a second */
  #tree-actions .nav.busy .nav-ring{animation:nav-ring-calm 1.2s ease-in-out infinite}
  @keyframes nav-ring-calm{50%{opacity:.25}}
}
