:root{
  --bg:#fbfaf8;
  --ink:#1c1a17;
  --text:rgba(34,30,26,.40);
  --ink-strong:rgba(30,26,22,.66);
  /* live colours pulled from the current cover (set by app.js) */
  --art-1:255,150,80;
  --art-2:230,120,60;
  --art-3:255,190,120;
  --glass:rgba(255,252,248,.42);
  --glass-strong:rgba(255,253,250,.62);
  --stroke:rgba(255,255,255,.58);
  --dark-pill:rgba(58,54,49,.44);
  --shadow:0 30px 80px -28px rgba(120,70,30,.42);
  --radius:34px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Helvetica Neue",Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
  min-height:100dvh;
  overflow:hidden;
  position:relative;
  -webkit-font-smoothing:antialiased;
}

/* ---------- Book page background — dense page, sharp near the player, soft toward the edges ---------- */
.book{
  position:fixed;inset:0;z-index:0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5vw;
  padding:5vh 5vw;
  font-family:"EB Garamond",Georgia,serif;
  font-size:clamp(16px,1.7vw,24px);
  line-height:1.3;
  color:var(--text);
  text-align:justify;
  user-select:none;
  /* text stays solid everywhere — the white overlay (.page-fade) is what dissolves
     it toward the edges, painted on top */
}
.book__col p{margin:0;text-indent:1.6em}
.book__col p:first-child{text-indent:0}
.book .ink{color:var(--ink-strong)}
.page-fade{
  position:fixed;inset:0;z-index:1;pointer-events:none;
  --w:251,250,248;
  /* white painted OVER the solid text: organic clear centre (shifted left so the RIGHT
     gets covered more), with varied corner/edge blobs — different dissolve on each side */
  background:
    radial-gradient(ellipse 53% 60% at 42% 50%, rgba(var(--w),0) 30%, rgba(var(--w),.78) 56%, rgba(var(--w),1) 78%),
    radial-gradient(54% 48% at 101% 0%,   rgba(var(--w),1), rgba(var(--w),0) 64%),
    radial-gradient(58% 56% at 101% 100%, rgba(var(--w),1), rgba(var(--w),0) 66%),
    radial-gradient(90% 64% at 116% 50%,  rgba(var(--w),1), rgba(var(--w),0) 66%),
    radial-gradient(40% 36% at 0% 1%,     rgba(var(--w),1), rgba(var(--w),0) 60%),
    radial-gradient(42% 40% at 0% 100%,   rgba(var(--w),1), rgba(var(--w),0) 60%),
    radial-gradient(56% 34% at -6% 50%,   rgba(var(--w),1), rgba(var(--w),0) 56%),
    radial-gradient(40% 62% at 47% -8%,   rgba(var(--w),1), rgba(var(--w),0) 56%),
    radial-gradient(44% 58% at 49% 108%,  rgba(var(--w),1), rgba(var(--w),0) 58%);
}

/* ---------- Stage ---------- */
.stage{
  position:relative;z-index:2;
  min-height:100dvh;
  display:flex;align-items:center;justify-content:center;
  padding:24px;
}
.glow{
  position:absolute;top:50%;left:50%;
  width:min(58vw,440px);height:min(64vw,470px);
  transform:translate(-50%,-48%);
  background:radial-gradient(circle, rgba(var(--art-1),.36), rgba(var(--art-2),.13) 44%, transparent 64%);
  filter:blur(36px);
  pointer-events:none;
  transition:background .9s ease;
  animation:breathe 7s ease-in-out infinite;
}
@keyframes breathe{50%{transform:translate(-50%,-48%) scale(1.07);opacity:.85}}

/* ---------- Card — light frosted glass (shows the book page behind) ---------- */
.card{
  position:relative;z-index:3;
  width:min(88vw,376px);
  padding:14px;
  border-radius:var(--radius);
  background:var(--glass);
  backdrop-filter:blur(30px) saturate(180%);
  -webkit-backdrop-filter:blur(30px) saturate(180%);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow), inset 0 1px 0 rgba(255,255,255,.7);
  overflow:visible;                 /* let the floating pills stick out */
  animation:rise .8s cubic-bezier(.2,.8,.2,1) both;
}
.art,.player{position:relative;z-index:2}
@keyframes rise{from{opacity:0;transform:translateY(18px) scale(.98)}}

/* Artwork — clean, no text */
.art{
  position:relative;
  aspect-ratio:1/1.04;
  border-radius:22px;overflow:hidden;
  background:linear-gradient(160deg, rgba(var(--art-1),.5), rgba(var(--art-2),.5));
}
.art img{width:100%;height:100%;object-fit:cover;display:block}
/* glass edge: beveled, refractive rim around the photo (like a thick glass tile) */
.art::after{
  content:"";position:absolute;inset:0;z-index:2;pointer-events:none;border-radius:inherit;
  background:
    radial-gradient(140% 75% at 50% -16%, rgba(255,255,255,.5), transparent 36%),
    radial-gradient(120% 65% at 50% 116%, rgba(255,255,255,.14), transparent 40%),
    radial-gradient(70% 120% at -12% 50%, rgba(255,255,255,.22), transparent 34%),
    radial-gradient(70% 120% at 112% 50%, rgba(0,0,0,.22), transparent 34%);
  mix-blend-mode:soft-light;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.5),
    inset 0 1.5px 1px rgba(255,255,255,.55),
    inset 0 -3px 8px rgba(0,0,0,.4),
    inset 6px 0 16px -8px rgba(255,255,255,.35),
    inset -6px 0 16px -8px rgba(0,0,0,.3),
    inset 0 0 22px -6px rgba(255,255,255,.18);
}

/* soft moving aurora from the cover's PASTEL palette — gentle, detailed, never muddy */
.card__bg{position:absolute;inset:0;z-index:0;border-radius:inherit;overflow:hidden}
.player__wash,.player__tint{position:absolute;inset:-55%;pointer-events:none}
.player__wash{
  background:
    radial-gradient(46% 54% at 22% 28%, rgba(var(--soft-1),.55), transparent 62%),
    radial-gradient(50% 58% at 78% 32%, rgba(var(--soft-3),.5), transparent 64%),
    radial-gradient(58% 62% at 52% 84%, rgba(var(--soft-2),.5), transparent 66%);
  filter:blur(32px) saturate(1.05);
  opacity:.85;
  animation:auroraA 24s ease-in-out infinite alternate;
}
.player__tint{
  background:
    radial-gradient(52% 58% at 72% 64%, rgba(var(--soft-4),.45), transparent 64%),
    radial-gradient(48% 56% at 26% 68%, rgba(var(--soft-5),.45), transparent 64%),
    radial-gradient(44% 50% at 60% 18%, rgba(var(--soft-3),.4), transparent 60%);
  filter:blur(40px) saturate(1.05);
  opacity:.7;
  animation:auroraB 31s ease-in-out infinite alternate;
}
@keyframes auroraA{
  0%{transform:translate(-6%,-4%) scale(1.12) rotate(-4deg)}
  50%{transform:translate(6%,4%) scale(1.32) rotate(5deg)}
  100%{transform:translate(-3%,6%) scale(1.18) rotate(-2deg)}
}
@keyframes auroraB{
  0%{transform:translate(5%,4%) scale(1.2) rotate(3deg)}
  50%{transform:translate(-6%,-5%) scale(1.38) rotate(-6deg)}
  100%{transform:translate(4%,-6%) scale(1.24) rotate(4deg)}
}
/* light veil keeps the card crisp & legible (pastels never go grey) */
.card__veil{
  position:absolute;inset:0;z-index:1;border-radius:inherit;pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.42));
}

/* ---------- Player — just the controls, sitting on the clean glass (no panel/box) ---------- */
.player{
  margin-top:14px;
  display:flex;flex-direction:column;gap:14px;
  padding:1px 2px 2px;
}

/* title + artist + star/more */
.player__head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.player__titles{display:flex;flex-direction:column;line-height:1.2;min-width:0}
.player__title{font-weight:700;font-size:17px;color:#211d18;letter-spacing:.2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.player__artist{font-size:13px;font-weight:500;color:rgba(33,29,24,.62);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.player__actions{display:flex;align-items:center;gap:9px;flex:none;margin-top:2px}
.rbtn{
  width:30px;height:30px;border-radius:50%;border:none;cursor:pointer;display:grid;place-items:center;
  color:#211d18;background:rgba(255,255,255,.5);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,.6);
  transition:background .15s, transform .12s, color .15s;
}
.rbtn:hover{background:rgba(255,255,255,.72)}
.rbtn:active{transform:scale(.9)}
.rbtn svg{width:16px;height:16px;fill:currentColor}
.rbtn.active{color:rgb(var(--art-1))}

/* scrubber — thin, dark, small knob */
.player__scrub{display:flex;flex-direction:column;gap:7px}
.player__bar{position:relative;height:5px;border-radius:99px;cursor:pointer;background:rgba(33,29,24,.18)}
.player__fill{height:100%;width:0;border-radius:99px;background:rgba(33,29,24,.78)}
.player__knob{                /* round iOS-26 liquid-glass thumb (track shows through) */
  position:absolute;top:50%;left:0;transform:translate(-50%,-50%);
  width:18px;height:18px;border-radius:50%;z-index:2;
  background:linear-gradient(180deg, rgba(255,255,255,.6) 0%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.34) 100%);
  backdrop-filter:blur(2px) saturate(1.5) brightness(1.1);
  -webkit-backdrop-filter:blur(2px) saturate(1.5) brightness(1.1);
  box-shadow:
    0 4px 12px -4px rgba(0,0,0,.35),
    0 1px 2px rgba(0,0,0,.18),
    inset 0 1.5px 1px rgba(255,255,255,.95),
    inset 0 -2px 3px rgba(255,255,255,.5),
    inset 0 0 0 1px rgba(255,255,255,.6),
    inset 0 0 7px -2px rgba(120,180,255,.4);
}
.player__times{display:flex;justify-content:space-between;font-size:11px;font-weight:600;
  color:rgba(33,29,24,.55);font-variant-numeric:tabular-nums}

/* transport — big plain dark glyphs, double-triangle skip */
.player__transport{display:flex;align-items:center;justify-content:center;gap:40px;margin-top:2px}
.tctrl{border:none;background:none;cursor:pointer;color:#211d18;display:grid;place-items:center;
  padding:0;transition:transform .14s ease, opacity .14s}
.tctrl:hover{opacity:.62}
.tctrl:active{transform:scale(.88)}
.tctrl svg{width:30px;height:30px;fill:currentColor;
  stroke:currentColor;stroke-width:2.4;stroke-linejoin:round;stroke-linecap:round}
.tctrl--play svg{width:40px;height:40px}
.ic-pause{display:none}
.player.playing .ic-play{display:none}
.player.playing .ic-pause{display:block}

/* volume — thin track + big iOS-26 liquid-glass capsule thumb */
.player__volume{display:flex;align-items:center;gap:17px;margin-top:2px}
.vico{width:18px;height:18px;flex:none;fill:rgba(33,29,24,.55)}
.vol{position:relative;flex:1;height:30px;display:flex;align-items:center;cursor:pointer;touch-action:none}
.vol::before{               /* unplayed track */
  content:"";position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);
  height:6px;border-radius:99px;background:rgba(33,29,24,.18);
}
.vol__fill{
  position:absolute;left:0;top:50%;transform:translateY(-50%);
  height:6px;width:100%;border-radius:99px;pointer-events:none;
  /* two main cover colours — soft, clean (no rainbow) */
  background:linear-gradient(90deg, rgba(var(--soft-1),.95), rgba(var(--soft-2),.95));
}
.vol__knob{                 /* iOS-26 liquid-glass capsule — even & symmetric, track shows THROUGH it */
  position:absolute;top:50%;left:100%;transform:translate(-50%,-50%);
  width:42px;height:28px;border-radius:99px;pointer-events:none;z-index:2;
  background:linear-gradient(180deg, rgba(255,255,255,.6) 0%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.34) 100%);
  backdrop-filter:blur(2px) saturate(1.5) brightness(1.1);
  -webkit-backdrop-filter:blur(2px) saturate(1.5) brightness(1.1);
  box-shadow:
    0 5px 14px -4px rgba(0,0,0,.38),
    0 1px 2px rgba(0,0,0,.18),
    inset 0 1.5px 1px rgba(255,255,255,.95),
    inset 0 -2px 3px rgba(255,255,255,.5),
    inset 0 0 0 1px rgba(255,255,255,.6),
    inset 0 0 8px -2px rgba(120,180,255,.4);   /* subtle, even glass edge */
}
.vol:focus-visible{outline:none}
.vol:focus-visible .vol__knob{box-shadow:0 5px 14px -4px rgba(0,0,0,.38), 0 0 0 4px rgba(var(--art-1),.35)}

/* shuffle / repeat — bigger toggles; active = accent colour only (no box / outline) */
.player__toggles{display:flex;align-items:center;justify-content:center;gap:40px;margin-top:2px}
.tg{position:relative;display:grid;place-items:center;border:none;background:none;cursor:pointer;
  width:40px;height:34px;color:rgba(33,29,24,.5);
  transition:color .15s, transform .12s;}
.tg:hover{color:rgba(33,29,24,.85)}
.tg:active{transform:scale(.92)}
.tg svg{width:25px;height:25px;display:block}
.tg.active{color:rgb(var(--art-1))}
.tg__one{position:absolute;right:3px;bottom:3px;font-size:9px;font-weight:800;
  display:none;color:inherit}
.tg.one .tg__one{display:block}

/* ---------- Floating pills — DARK frosted glass, clear of the card ---------- */
.pill{
  position:absolute;z-index:4;
  display:inline-flex;align-items:center;gap:9px;
  padding:11px 16px;border-radius:14px;cursor:pointer;
  font-size:13px;font-weight:600;color:#fff;
  background:var(--dark-pill);
  backdrop-filter:blur(26px) saturate(155%);
  -webkit-backdrop-filter:blur(26px) saturate(155%);
  border:1px solid rgba(255,255,255,.16);
  box-shadow:0 16px 34px -16px rgba(40,20,0,.6), inset 0 1px 0 rgba(255,255,255,.18);
  transition:transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, background .18s;
  white-space:nowrap;
}
.pill:hover{transform:translateY(-2px);background:rgba(70,65,59,.56);box-shadow:0 22px 44px -16px rgba(var(--art-1),.5)}
.pill:active{transform:translateY(0) scale(.97)}
.pill .ico{width:18px;height:18px;fill:#fff;opacity:.92}
.pill .ico--spark{width:19px;height:19px}   /* sparkle: a hair larger as the accent */
/* stroke-only (outline) icons must stay hollow — CSS fill above would otherwise fill them */
.pill .ico[fill="none"], .rbtn svg[fill="none"]{fill:none}
.rbtn.active svg[fill="none"]{fill:currentColor}

/* positions (desktop) — clustered around the cover: one straddling the top,
   three hugging the right edge. .actions is a zero-impact positioned wrapper so the
   abs-positioned pills stay relative to the card AND scale WITH it on mobile
   (display:contents would let them escape the card's transform → rail clipped off-screen) */
.actions{position:absolute;inset:0;z-index:4;pointer-events:none}
.actions .pill{pointer-events:auto}
.pill--social{top:-16px;left:52%}
.rail{
  position:absolute;z-index:4;
  top:40px;left:calc(100% - 8px);
  display:flex;flex-direction:column;gap:16px;align-items:flex-start;
}
.rail .pill{position:relative;top:auto;left:auto}   /* all left-aligned, even (no stagger) */
.pill--chat{top:40px;right:calc(100% - 8px)}        /* mirrors the right rail, on the left */

/* ---------- Social popover (light) ---------- */
.pop{
  position:fixed;z-index:30;
  width:252px;padding:8px;border-radius:20px;
  background:var(--glass-strong);
  backdrop-filter:blur(26px) saturate(170%);
  -webkit-backdrop-filter:blur(26px) saturate(170%);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow);
  animation:pop .18s ease both;
}
@keyframes pop{from{opacity:0;transform:scale(.95) translateY(6px)}}
.pop__row{
  display:flex;align-items:center;gap:11px;
  padding:11px 12px;border-radius:13px;
  text-decoration:none;color:var(--ink);
  transition:background .15s;
}
.pop__row:hover{background:rgba(var(--art-1),.18)}
.pop__row .ico{width:21px;height:21px;fill:var(--ink);opacity:.85}
.pop__name{font-weight:600;font-size:14px}
.pop__handle{margin-left:auto;font-size:12.5px;color:#8a8073}

/* ---------- Wish modal ---------- */
.modal{
  position:fixed;inset:0;z-index:40;
  display:grid;place-items:center;padding:24px;
  background:rgba(40,30,20,.28);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  animation:fade .2s ease both;
}
@keyframes fade{from{opacity:0}}
.modal__sheet{
  width:min(92vw,380px);padding:18px;border-radius:26px;
  background:var(--glass-strong);
  backdrop-filter:blur(28px) saturate(170%);
  -webkit-backdrop-filter:blur(28px) saturate(170%);
  border:1px solid var(--stroke);
  box-shadow:var(--shadow);
  animation:rise .35s cubic-bezier(.2,.8,.2,1) both;
}
.modal__head{display:flex;align-items:center;gap:9px;font-weight:700;font-size:15px;margin-bottom:14px}
.modal__head .ico{width:19px;height:19px;fill:rgb(var(--art-1))}
.modal__x{margin-left:auto;border:none;background:none;font-size:26px;line-height:1;cursor:pointer;color:#8a8073}
#wishText{
  width:100%;min-height:110px;resize:none;
  padding:13px 14px;border-radius:16px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.7);
  font-family:inherit;font-size:14px;color:var(--ink);
}
#wishText:focus{outline:2px solid rgba(var(--art-1),.55);outline-offset:1px}
.modal__send{
  margin-top:13px;width:100%;padding:13px;border:none;border-radius:15px;cursor:pointer;
  font-family:inherit;font-weight:700;font-size:14px;color:#fff;
  background:linear-gradient(155deg, rgb(var(--art-1)), rgb(var(--art-2)));
  box-shadow:0 12px 26px -10px rgba(var(--art-1),.8);
  transition:transform .15s;
}
.modal__send:active{transform:scale(.98)}

/* ---------- Toast ---------- */
.toast{
  position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);
  z-index:50;padding:12px 20px;border-radius:14px;
  background:rgba(28,26,23,.9);color:#fff;font-size:13.5px;font-weight:500;
  box-shadow:0 16px 36px -14px rgba(0,0,0,.6);
  opacity:0;pointer-events:none;transition:opacity .25s, transform .25s;
}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ---------- Signature / wordmark (bottom-centre) — minimal, Apple font ---------- */
.sig{
  position:fixed;left:50%;bottom:15px;transform:translateX(-50%);
  z-index:20;
  font-weight:500;font-size:13px;letter-spacing:.2px;
  color:rgba(33,29,24,.38);text-decoration:none;white-space:nowrap;
  transition:color .2s ease;
}
.sig:hover{color:rgba(33,29,24,.7)}
.sig--top{top:15px;bottom:auto}

/* ---------- Panel: the player morphs into the chat in the same footprint ---------- */
.panel{position:relative;margin-top:14px}
.player{margin-top:0}
.player{transition:opacity .28s ease}
.chat{
  position:absolute;inset:0;z-index:3;
  display:flex;flex-direction:column;gap:9px;
  opacity:0;pointer-events:none;transition:opacity .28s ease;
}
.card.chatting .player{opacity:0;pointer-events:none}
.card.chatting .chat{opacity:1;pointer-events:auto}

.chat__head{display:flex;align-items:center;gap:9px;flex:none}
.chat__avatar{width:30px;height:30px;flex:none;border-radius:50%;border:1px solid rgba(33,29,24,.16);
  background:rgba(255,255,255,.55) center/cover no-repeat;cursor:pointer;padding:0;overflow:hidden;
  display:grid;place-items:center;color:rgb(var(--art-1));font-weight:700;font-size:13px}
.chat__name{flex:1;min-width:0;border:none;background:rgba(33,29,24,.06);border-radius:9px;
  padding:7px 11px;font:600 13px/1 inherit;color:#23201b}
.chat__name:focus{outline:2px solid rgba(var(--art-1),.5)}
.chat__close{flex:none;width:28px;height:28px;border:none;background:none;cursor:pointer;
  color:rgba(33,29,24,.5);display:grid;place-items:center;border-radius:50%}
.chat__close:hover{background:rgba(33,29,24,.08);color:#23201b}
.chat__close svg{width:17px;height:17px}

.chat__list{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  display:flex;flex-direction:column;gap:8px;padding-right:2px}
.chat__empty{margin:auto;text-align:center;color:rgba(33,29,24,.42);font-size:12.5px;padding:10px}
.cmsg{display:flex;gap:8px;align-items:flex-start;max-width:90%}
.cmsg.me{align-self:flex-end;flex-direction:row-reverse}
.cmsg__av{width:26px;height:26px;flex:none;border-radius:50%;overflow:hidden;
  background:rgba(33,29,24,.18) center/cover no-repeat;display:grid;place-items:center;
  font-size:11px;font-weight:700;color:#fff}
.cmsg__b{background:rgba(255,255,255,.6);border:1px solid rgba(255,255,255,.7);
  border-radius:13px;padding:6px 10px;min-width:0}
.cmsg.me .cmsg__b{background:rgba(var(--art-1),.18);border-color:rgba(var(--art-1),.25)}
.cmsg__name{font-size:10.5px;font-weight:700;color:rgba(33,29,24,.6);margin-bottom:1px}
.cmsg.me .cmsg__name{display:none}
.cmsg__text{font-size:13px;line-height:1.35;color:#23201b;overflow-wrap:anywhere;white-space:pre-wrap}
.cmsg__photo{display:block;margin-top:5px;max-width:150px;max-height:150px;border-radius:9px;cursor:pointer}
.cmsg__time{font-size:9px;color:rgba(33,29,24,.4);text-align:right;margin-top:2px}

.chat__compose{display:flex;align-items:center;gap:7px;flex:none}
.chat__attach,.chat__send{flex:none;width:32px;height:32px;border:none;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;transition:background .15s,transform .12s,color .15s}
.chat__attach{background:rgba(33,29,24,.07);color:rgba(33,29,24,.62)}
.chat__attach:hover{background:rgba(33,29,24,.13)}
.chat__attach.has{background:rgba(var(--art-1),.16);color:rgb(var(--art-1))}
.chat__attach svg{width:18px;height:18px}
.chat__text{flex:1;min-width:0;border:none;background:rgba(33,29,24,.06);border-radius:99px;
  padding:8px 13px;font:500 13px/1.2 inherit;color:#23201b}
.chat__text:focus{outline:2px solid rgba(var(--art-1),.45)}
.chat__send{background:linear-gradient(155deg,rgb(var(--art-1)),rgb(var(--art-2)));color:#fff}
.chat__send svg{width:17px;height:17px;fill:#fff;margin-left:1px}
.chat__attach:active,.chat__send:active{transform:scale(.9)}

/* ---------- Leave a wish — the pill ITSELF morphs into the wish box (one element, no modal) ----------
   Closed: looks like a normal pill. Open: the same element smoothly grows (width + height) into a box.
   Width animates between fixed px (NOT max-content, which can't be interpolated → would jump). */
.wish{
  position:relative;width:158px;        /* ~the natural width of the "Leave a wish" label pill */
  display:flex;flex-direction:column;overflow:hidden;
  background:var(--dark-pill);
  backdrop-filter:blur(26px) saturate(155%);-webkit-backdrop-filter:blur(26px) saturate(155%);
  border:1px solid rgba(255,255,255,.16);border-radius:14px;
  box-shadow:0 16px 34px -16px rgba(40,20,0,.6), inset 0 1px 0 rgba(255,255,255,.18);
  transition:width .42s cubic-bezier(.22,.9,.24,1), box-shadow .24s ease, transform .18s cubic-bezier(.2,.8,.2,1), background .2s ease;
}
.wish:not(.open):hover{transform:translateY(-2px);background:rgba(70,65,59,.56);box-shadow:0 22px 44px -16px rgba(var(--art-1),.5)}
.wish.open{width:214px;box-shadow:0 24px 48px -16px rgba(var(--art-1),.5), inset 0 1px 0 rgba(255,255,255,.2)}
.wish__trigger{
  display:flex;align-items:center;justify-content:center;gap:9px;white-space:nowrap;flex:none;
  padding:11px 16px;border:none;background:none;cursor:pointer;
  font:600 13px inherit;color:#fff;
}
.wish__trigger .ico{width:19px;height:19px;fill:#fff;opacity:.95;flex:none}
.wish__label{transition:opacity .2s ease}
/* the body that unfolds inside the same pill as it grows */
.wish__panel{
  max-height:0;opacity:0;overflow:hidden;padding:0 11px;
  transition:max-height .42s cubic-bezier(.22,.9,.24,1), opacity .26s ease, padding .42s cubic-bezier(.22,.9,.24,1);
}
.wish.open .wish__panel{max-height:150px;opacity:1;padding:0 11px 11px}
.wish__text{
  width:100%;box-sizing:border-box;resize:none;border:none;border-radius:10px;
  background:rgba(255,255,255,.14);color:#fff;font:500 13px/1.35 inherit;padding:9px 11px;min-height:52px;
}
.wish__text::placeholder{color:rgba(255,255,255,.5)}
.wish__text:focus{outline:1px solid rgba(255,255,255,.4)}
.wish__row{display:flex;gap:7px;margin-top:8px}
.wish__cancel,.wish__send{flex:1;border:none;border-radius:9px;cursor:pointer;font:600 12.5px inherit;padding:8px;transition:transform .12s,filter .15s}
.wish__cancel{background:rgba(255,255,255,.14);color:#fff}
.wish__send{background:linear-gradient(155deg,rgb(var(--art-1)),rgb(var(--art-2)));color:#fff}
.wish__send:hover{filter:brightness(1.06)}
.wish__cancel:active,.wish__send:active{transform:scale(.96)}
.wish__done{
  position:absolute;inset:0;display:none;place-items:center;border-radius:14px;
  background:rgba(38,34,30,.72);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);
  color:#fff;font:700 14px inherit;letter-spacing:.3px;
}
.wish.sent .wish__done{display:grid;animation:wishpop .4s ease}
@keyframes wishpop{from{opacity:0;transform:scale(.92)}}

[hidden]{display:none !important}

/* ---------- Responsive: keep the EXACT desktop composition (floating pills around
   the card, two-column book, white dissolve) — just shrink it to fit narrow screens ---------- */
@media (max-width:760px){
  body{overflow-x:hidden}
  .rail{left:calc(100% - 10px)}
  /* thumb-reachable bottom corners on a phone: Social bottom-right, Chat bottom-left */
  .pill--social{top:auto;left:auto;bottom:-15px;right:14px}
  .pill--chat{top:auto;right:auto;bottom:-15px;left:14px}
  /* the desktop dissolve is "heavy right" (big right blob) — on a narrow screen that
     whites out almost all the right text, so use a balanced, centred dissolve here */
  .page-fade{
    background:
      radial-gradient(ellipse 56% 60% at 50% 50%, rgba(var(--w),0) 36%, rgba(var(--w),.72) 60%, rgba(var(--w),1) 82%),
      radial-gradient(44% 44% at 0% 0%,     rgba(var(--w),1), rgba(var(--w),0) 60%),
      radial-gradient(46% 46% at 100% 0%,   rgba(var(--w),1), rgba(var(--w),0) 60%),
      radial-gradient(48% 48% at 100% 100%, rgba(var(--w),1), rgba(var(--w),0) 62%),
      radial-gradient(44% 46% at 0% 100%,   rgba(var(--w),1), rgba(var(--w),0) 60%),
      radial-gradient(38% 44% at -4% 50%,   rgba(var(--w),1), rgba(var(--w),0) 56%),
      radial-gradient(38% 44% at 104% 50%,  rgba(var(--w),1), rgba(var(--w),0) 56%);
  }
}
/* shrink the desktop composition to fit — card stays CENTRED (no left shift),
   scaled just enough that the floating right rail still fits */
@media (max-width:700px){ .card{animation:none;transform-origin:center;transform:scale(.86)} }
@media (max-width:620px){ .card{transform:scale(.76)} }
@media (max-width:540px){ .card{transform:scale(.68)} }
@media (max-width:460px){ .card{transform:scale(.58)} }
@media (max-width:400px){ .card{transform:scale(.5)} }
@media (max-width:350px){ .card{transform:scale(.44)} }
