
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html, body {
      height: 100%; overflow: hidden;
      font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
      background: #07080c; color: #fff;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }
    .stage {
      position: relative; width: 100%; height: 100dvh;
      display: grid; place-items: center; overflow: hidden;
    }
    .bg {
      position: absolute; inset: -10%;
      background-size: cover; background-position: center;
      filter: blur(32px) saturate(1.2); transform: scale(1.1);
      opacity: .42; transition: background-image .9s, opacity .9s;
    }
    .bg::after {
      content: ""; position: absolute; inset: 0;
      background:
        radial-gradient(ellipse at 20% 20%, rgba(255,120,180,.22), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255,200,120,.14), transparent 45%),
        linear-gradient(180deg, rgba(7,8,12,.2), rgba(7,8,12,.55));
    }

    .fx {
      position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
    }
    .spark {
      position: absolute; width: 6px; height: 6px; border-radius: 50%;
      background: radial-gradient(circle, #fff 0%, #ffd6ea 40%, transparent 70%);
      box-shadow: 0 0 10px rgba(255,200,230,.9), 0 0 22px rgba(255,140,190,.45);
      animation: twinkle var(--d, 3s) ease-in-out infinite;
      opacity: .75;
    }
    .spark.heart {
      width: 10px; height: 10px; border-radius: 0;
      background: transparent; box-shadow: none;
      font-size: 11px; line-height: 1; color: #ff8ab8;
      text-shadow: 0 0 12px rgba(255,120,180,.8);
      animation: floatHeart var(--d, 7s) linear infinite;
    }
    .spark.petal {
      width: 8px; height: 12px; border-radius: 60% 40% 60% 40%;
      background: linear-gradient(135deg, #ffb7d0, #ff6fa8);
      box-shadow: 0 0 8px rgba(255,130,180,.5);
      animation: driftPetal var(--d, 9s) linear infinite;
    }
    @keyframes twinkle {
      0%, 100% { transform: scale(.4); opacity: .25; }
      50% { transform: scale(1.35); opacity: 1; }
    }
    @keyframes floatHeart {
      0% { transform: translateY(110vh) rotate(0deg) scale(.6); opacity: 0; }
      12% { opacity: .9; }
      100% { transform: translateY(-12vh) rotate(28deg) scale(1.1); opacity: 0; }
    }
    @keyframes driftPetal {
      0% { transform: translate3d(0, -8vh, 0) rotate(0deg); opacity: 0; }
      10% { opacity: .85; }
      100% { transform: translate3d(40px, 110vh, 0) rotate(220deg); opacity: 0; }
    }

    .toolbar {
      position: absolute;
      left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      top: auto; transform: translateX(-50%);
      z-index: 8;
      display: flex; flex-direction: row; flex-wrap: nowrap;
      align-items: stretch; justify-content: center; gap: 4px;
      width: max-content; max-width: calc(100vw - 16px);
      padding: 6px 8px; border-radius: 22px;
      background: rgba(8, 8, 14, .55);
      border: 1px solid rgba(255,255,255,.12);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      box-sizing: border-box;
      box-shadow: 0 10px 28px rgba(0,0,0,.35);
    }
    .toolbar button {
      display: inline-flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 3px;
      flex: 0 0 auto; width: auto; min-width: 58px;
      border: 1px solid transparent;
      background: transparent;
      color: rgba(255,255,255,.88);
      font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
      font-weight: 600; font-size: .58rem; line-height: 1.15;
      letter-spacing: 0;
      padding: 7px 8px 6px; border-radius: 16px;
      cursor: pointer;
      transition: background .25s, color .25s, transform .2s, box-shadow .25s;
      white-space: nowrap;
    }
    .toolbar button .lbl {
      display: block;
      max-width: none;
      overflow: visible;
      text-overflow: clip;
    }
    .toolbar button .ico {
      width: 18px; height: 18px; flex-shrink: 0;
      display: block;
    }
    .toolbar button .ico svg {
      width: 100%; height: 100%; display: block;
    }
    .toolbar button:hover { background: rgba(255,255,255,.12); }
    .toolbar button.on {
      background: linear-gradient(160deg, rgba(255,110,170,.95), rgba(255,80,140,.9));
      color: #fff;
      box-shadow: 0 6px 16px rgba(255,80,140,.32);
    }
    .toolbar button.on .ico { filter: drop-shadow(0 0 4px rgba(255,255,255,.35)); }
    .toolbar button:active { transform: scale(.96); }

    .hint {
      position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
      z-index: 7; font-size: .72rem; color: rgba(255,255,255,.72);
      background: rgba(0,0,0,.38); padding: 6px 12px; border-radius: 999px;
      backdrop-filter: blur(8px); white-space: nowrap; max-width: 92vw;
      transition: opacity .4s;
    }
    .hint.hide { opacity: 0; pointer-events: none; }

    .sig {
      position: absolute;
      bottom: calc(78px + env(safe-area-inset-bottom, 0px));
      left: 50%; transform: translateX(-50%);
      z-index: 7; color: #ff9ec4;
      font-family: "Mali", "Be Vietnam Pro", sans-serif;
      font-weight: 600; font-style: italic; font-size: .95rem;
      text-align: center; max-width: 90vw;
      text-shadow: 0 0 18px rgba(255,120,180,.45);
    }

    /* —— Slideshow —— */
    .frame-wrap {
      position: relative; z-index: 3;
      width: min(720px, 92vw); max-height: 72vh;
      perspective: 1200px;
    }
    .frame {
      position: relative; width: 100%; aspect-ratio: 4/5; max-height: 72vh;
      border-radius: 18px; overflow: hidden;
      box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 40px rgba(255,120,180,.12);
      border: 1px solid rgba(255,255,255,.14); background: #111;
      transform-style: preserve-3d;
    }
    .frame .layer {
      position: absolute; inset: 0;
      opacity: 0; pointer-events: none;
      will-change: transform, opacity, filter;
    }
    .frame .layer img {
      width: 100%; height: 100%; object-fit: cover; display: block;
    }
    .frame .layer.active { opacity: 1; pointer-events: auto; z-index: 2; }

    /* transitions */
    .fx-fade .layer { transition: opacity .85s ease; }
    .fx-slide .layer {
      transition: transform .75s cubic-bezier(.22,.9,.3,1), opacity .55s ease;
      transform: translateX(28%);
    }
    .fx-slide .layer.active { transform: translateX(0); }
    .fx-slide .layer.exit { transform: translateX(-28%); opacity: 0; }
    .fx-zoom .layer {
      transition: transform .9s ease, opacity .7s ease;
      transform: scale(1.18);
    }
    .fx-zoom .layer.active { transform: scale(1); }
    .fx-zoom .layer.exit { transform: scale(.88); opacity: 0; }
    .fx-flip .layer {
      transition: transform .85s cubic-bezier(.4,.1,.2,1), opacity .4s;
      transform: rotateY(90deg); transform-origin: center;
    }
    .fx-flip .layer.active { transform: rotateY(0); }
    .fx-flip .layer.exit { transform: rotateY(-90deg); opacity: 0; }
    .fx-kenburns .layer { transition: opacity .9s ease; }
    .fx-kenburns .layer.active img {
      animation: kenburns 8.5s ease-in-out infinite alternate;
    }
    @keyframes kenburns {
      from { transform: scale(1) translate(0,0); }
      to { transform: scale(1.12) translate(-2%, -1.5%); }
    }
    .fx-dissolve .layer {
      transition: opacity 1s ease, filter 1s ease;
      filter: blur(12px) brightness(1.3);
    }
    .fx-dissolve .layer.active { filter: blur(0) brightness(1); }
    .fx-stack .layer {
      transition: transform .7s cubic-bezier(.22,.9,.3,1), opacity .5s;
      transform: translateY(18px) rotate(4deg) scale(.94);
      border-radius: 8px; overflow: hidden;
      box-shadow: 0 12px 30px rgba(0,0,0,.35);
    }
    .fx-stack .layer.active { transform: translateY(0) rotate(0) scale(1); }
    .fx-stack .layer.exit { transform: translateY(-24px) rotate(-6deg) scale(.9); opacity: 0; }

    .caption {
      position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
      padding: 28px 22px 20px;
      background: linear-gradient(180deg, transparent, rgba(0,0,0,.78));
      font-family: "Mali", "Be Vietnam Pro", sans-serif;
      font-weight: 600; font-style: italic;
      font-size: clamp(1.05rem, 3.2vw, 1.42rem); line-height: 1.45;
      pointer-events: none;
    }
    .nav { position: absolute; inset: 0; z-index: 4; display: flex; }
    .nav button { flex: 1; border: 0; background: transparent; cursor: pointer; }
    .progress {
      position: absolute; top: 10px; left: 12px; right: 12px; z-index: 6;
      display: flex; gap: 4px; height: 3px;
    }
    .progress i {
      flex: 1; border-radius: 99px; background: rgba(255,255,255,.22);
      overflow: hidden;
    }
    .progress i::after {
      content: ""; display: block; height: 100%; width: 0;
      background: linear-gradient(90deg, #ff9ec4, #fff);
      border-radius: inherit;
    }
    .progress i.done::after { width: 100%; }
    .progress i.on::after { width: var(--p, 0%); transition: width .12s linear; }

    /* —— Gallery —— */
    .gallery {
      position: absolute; inset: 0; z-index: 3;
      display: none; padding: 72px 14px 64px;
      overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .stage.mode-gallery .gallery { display: block; }
    .stage.mode-gallery .frame-wrap,
    .stage.mode-gallery .album { display: none; }
    .gallery-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 10px; max-width: 900px; margin: 0 auto;
    }
    .gallery-item {
      position: relative; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden;
      border: 1px solid rgba(255,255,255,.12);
      box-shadow: 0 12px 28px rgba(0,0,0,.35);
      cursor: pointer; animation: popIn .45s ease both;
      background: #15151c;
    }
    .gallery-item:nth-child(odd) { animation-delay: .04s; }
    .gallery-item:nth-child(3n) { animation-delay: .08s; }
    .gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
    .gallery-item:hover img { transform: scale(1.06); }
    .gallery-item span {
      position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 10px 10px;
      background: linear-gradient(transparent, rgba(0,0,0,.75));
      font-size: .72rem; line-height: 1.3; color: rgba(255,255,255,.9);
    }
    @keyframes popIn {
      from { opacity: 0; transform: scale(.92) translateY(10px); }
      to { opacity: 1; transform: none; }
    }

    /* —— Album (sổ ảnh mở) —— */
    .album {
      display: none; position: relative; z-index: 3;
      width: min(880px, 94vw);
      height: min(66vh, 540px);
      perspective: 1800px;
    }
    .stage.mode-album .album { display: block; }
    .stage.mode-album .frame-wrap,
    .stage.mode-album .gallery { display: none; }
    .stage.mode-album .sig { opacity: .85; }
    .album-book {
      position: relative; width: 100%; height: 100%;
      display: grid; grid-template-columns: 1fr 1fr; gap: 0;
      border-radius: 4px 14px 14px 4px;
      background:
        linear-gradient(90deg,
          #f3ebe0 0%, #faf6f0 42%,
          #e8dfd4 49.5%, #d9cfc3 50%, #e8dfd4 50.5%,
          #faf6f0 58%, #f3ebe0 100%);
      box-shadow:
        0 28px 70px rgba(0,0,0,.5),
        0 0 0 1px rgba(90,60,50,.12),
        inset 0 0 0 1px rgba(255,255,255,.55);
      overflow: hidden;
      transform-style: preserve-3d;
    }
    .album-book::before {
      content: "";
      position: absolute; inset: 0; z-index: 0; pointer-events: none;
      opacity: .35;
      background-image:
        radial-gradient(ellipse at 20% 30%, rgba(180,140,100,.08), transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(160,120,90,.06), transparent 45%);
    }
    .album-cover-edge {
      position: absolute; left: 0; top: 0; bottom: 0; width: 10px; z-index: 5;
      background: linear-gradient(90deg, #5c2a3a, #8b3d55 40%, #6e3144);
      box-shadow: 2px 0 8px rgba(0,0,0,.25);
      pointer-events: none;
    }
    .album-page {
      position: relative; z-index: 1;
      padding: 22px 20px 28px;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 12px; min-height: 0;
    }
    .album-page.left { padding-right: 28px; padding-left: 26px; }
    .album-page.right { padding-left: 28px; padding-right: 22px; }
    .album-shot {
      position: relative;
      width: min(100%, 280px);
      aspect-ratio: 3 / 4;
      max-height: calc(100% - 52px);
      border-radius: 2px; overflow: hidden;
      background: #ddd;
      border: 10px solid #fff;
      box-shadow:
        0 2px 0 rgba(0,0,0,.04),
        0 10px 28px rgba(60,30,40,.22),
        0 0 0 1px rgba(0,0,0,.06);
      transform: rotate(var(--tilt, -1.5deg));
      transition: transform .35s ease;
      flex-shrink: 1;
    }
    .album-page.right .album-shot { --tilt: 1.6deg; }
    .album-shot:hover { transform: rotate(0) scale(1.02); }
    .album-shot img {
      width: 100%; height: 100%; object-fit: cover; display: block;
    }
    .album-shot::after {
      content: "";
      position: absolute; inset: 0; pointer-events: none;
      box-shadow: inset 0 0 30px rgba(0,0,0,.08);
    }
    .album-cap {
      position: static;
      width: 100%; max-width: 260px;
      font-family: "Mali", "Be Vietnam Pro", sans-serif;
      font-weight: 600; font-style: italic;
      font-size: clamp(.88rem, 2.2vw, 1.08rem);
      line-height: 1.35;
      color: #6a4452;
      text-align: center;
      text-shadow: none;
      pointer-events: none;
      min-height: 1.4em;
    }
    .album-page-num {
      position: absolute; bottom: 10px; z-index: 2;
      font-family: "Be Vietnam Pro", sans-serif;
      font-size: .62rem; letter-spacing: .08em;
      color: rgba(90,60,70,.45); pointer-events: none;
    }
    .album-page.left .album-page-num { left: 28px; }
    .album-page.right .album-page-num { right: 22px; }
    .album-nav {
      position: absolute; inset: 0; z-index: 4; display: flex;
    }
    .album-nav button { flex: 1; border: 0; background: transparent; cursor: pointer; }
    .album-spine {
      position: absolute; left: 50%; top: 0; bottom: 0; width: 18px;
      transform: translateX(-50%); z-index: 3; pointer-events: none;
      background:
        linear-gradient(90deg,
          rgba(0,0,0,.14),
          rgba(255,255,255,.35) 35%,
          rgba(0,0,0,.1) 50%,
          rgba(255,255,255,.25) 65%,
          rgba(0,0,0,.16));
      box-shadow: 0 0 24px rgba(0,0,0,.18);
    }
    .album-flip { animation: albumFlip .55s ease; }
    @keyframes albumFlip {
      0% { transform: rotateY(-10deg) scale(.98); opacity: .7; }
      100% { transform: none; opacity: 1; }
    }
    .album-hint-flip {
      position: absolute; bottom: -28px; left: 50%; transform: translateX(-50%);
      font-size: .68rem; color: rgba(255,255,255,.55);
      white-space: nowrap; pointer-events: none;
    }

    /* —— Cute mode = Polaroid (Pola) —— */
    .stage.mode-cute .frame-wrap {
      width: min(420px, 88vw);
      max-height: min(78vh, 640px);
      transform: rotate(-1.2deg);
      filter: drop-shadow(0 22px 40px rgba(0,0,0,.45));
    }
    .stage.mode-cute .frame {
      aspect-ratio: 3.4 / 4.15;
      max-height: min(78vh, 640px);
      border-radius: 3px;
      border: none;
      background:
        linear-gradient(165deg, #fffcf8 0%, #f4efe8 55%, #ebe4db 100%);
      box-shadow:
        0 1px 0 rgba(255,255,255,.7) inset,
        0 0 0 1px rgba(0,0,0,.06),
        0 18px 50px rgba(0,0,0,.4);
      overflow: hidden;
    }
    /* Ảnh nằm trong ô pola — viền mỏng 3 cạnh, đáy dày */
    .stage.mode-cute .frame .layer {
      top: 4.6%;
      left: 5.2%;
      right: 5.2%;
      bottom: 19.5%;
      border-radius: 1px;
      overflow: hidden;
      background: #1a1a1a;
    }
    .stage.mode-cute .frame .layer img {
      border-radius: 0;
    }
    .stage.mode-cute .fx-stack .layer {
      border-radius: 1px;
      box-shadow: none;
    }
    /* Chú thích trên phần “cằm” trắng — không đè ảnh */
    .stage.mode-cute .caption {
      top: auto;
      left: 5%;
      right: 5%;
      bottom: 0;
      height: 19.5%;
      padding: 6px 8px 10px;
      background: transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      font-family: "Mali", "Be Vietnam Pro", sans-serif;
      font-weight: 600;
      font-style: italic;
      font-size: clamp(.92rem, 3.4vw, 1.2rem);
      line-height: 1.35;
      color: #6b4a58;
      text-shadow: none;
    }
    .stage.mode-cute .progress {
      top: calc(4.6% + 7px);
      left: calc(5.2% + 8px);
      right: calc(5.2% + 8px);
    }
    .stage.mode-cute .progress i {
      background: rgba(255,255,255,.35);
    }
    .stage.mode-cute .nav {
      top: 4.6%;
      left: 5.2%;
      right: 5.2%;
      bottom: 19.5%;
    }
    .stage.mode-cute .sig {
      font-family: "Mali", "Be Vietnam Pro", sans-serif;
      font-weight: 600; font-style: italic;
      font-size: 1.05rem; color: #ffb0d0;
    }
    .stage.mode-cute .bg { filter: blur(28px) saturate(1.35) hue-rotate(-6deg); opacity: .48; }
    .cute-stickers {
      position: absolute; inset: 0; z-index: 6; pointer-events: none;
      display: none;
    }
    .stage.mode-cute .cute-stickers { display: block; }
    .sticker {
      position: absolute; font-size: clamp(1rem, 3.6vw, 1.45rem);
      filter: drop-shadow(0 3px 6px rgba(0,0,0,.2));
      animation: stickerBob 3.2s ease-in-out infinite;
      color: #e889b0;
    }
    /* Sticker góc khung pola (vùng trắng), không che ảnh */
    .sticker:nth-child(1) { top: 1.2%; left: 1.5%; animation-delay: 0s; }
    .sticker:nth-child(2) { top: 1.2%; right: 1.5%; animation-delay: .4s; }
    .sticker:nth-child(3) { bottom: 4%; left: 3%; animation-delay: .8s; font-size: .95rem; }
    .sticker:nth-child(4) { bottom: 4%; right: 3%; animation-delay: 1.1s; font-size: .95rem; }
    .sticker:nth-child(5) { top: 38%; left: -1%; font-size: .9rem; animation-delay: .2s; opacity: .85; }
    .sticker:nth-child(6) { top: 42%; right: -1%; font-size: .9rem; animation-delay: .6s; opacity: .85; }
    @keyframes stickerBob {
      0%, 100% { transform: translateY(0) rotate(-6deg); }
      50% { transform: translateY(-6px) rotate(6deg); }
    }

    .stage.mode-gallery .hint,
    .stage.mode-album .hint { top: 14px; }

    @media (max-width: 640px) {
      .album {
        width: min(360px, 92vw);
        height: min(62vh, 480px);
      }
      .album-book {
        grid-template-columns: 1fr;
        border-radius: 4px 12px 12px 4px;
        background:
          linear-gradient(105deg, #faf6f0 0%, #f3ebe0 70%, #ebe2d6 100%);
      }
      .album-page.left { display: none; }
      .album-spine {
        left: 0; transform: none; width: 12px;
        background: linear-gradient(90deg, #5c2a3a, #8b3d55 55%, rgba(0,0,0,.08));
      }
      .album-cover-edge { display: none; }
      .album-page.right {
        display: flex;
        padding: 28px 18px 36px 28px;
      }
      .album-page.right .album-shot {
        --tilt: -.6deg;
        width: min(100%, 260px);
        border-width: 9px;
      }
      .album-page.right .album-page-num { right: 16px; left: auto; }
      .album-cap { max-width: 240px; color: #6a4452; }
      .toolbar {
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        gap: 2px; padding: 5px 6px;
        max-width: calc(100vw - 12px);
      }
      .toolbar button {
        min-width: 56px; padding: 6px 4px 5px; font-size: .52rem; gap: 2px;
      }
      .toolbar button .ico { width: 16px; height: 16px; }
      .toolbar button .lbl {
        display: block; max-width: none;
        overflow: visible; text-overflow: clip;
        font-size: .52rem;
      }
      .sig { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
      .hint { top: 12px; font-size: .68rem; }
      .gallery-grid { grid-template-columns: repeat(2, 1fr); }
      .stage.mode-cute .frame-wrap {
        width: min(340px, 90vw);
        transform: rotate(-.8deg);
      }
      .stage.mode-cute .caption {
        font-size: clamp(.82rem, 3.6vw, 1.05rem);
        padding: 4px 6px 8px;
      }
    }
    @media (min-width: 641px) {
      .toolbar button { min-width: 70px; font-size: .62rem; padding: 8px 10px 7px; }
      .toolbar button .ico { width: 19px; height: 19px; }
    }
  
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:300 400;font-display:swap;src:url("/assets/galaxia-infinita/fonts/be-vietnam-pro-400.woff2") format("woff2")}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:500 900;font-display:swap;src:url("/assets/galaxia-infinita/fonts/be-vietnam-pro-600.woff2") format("woff2")}
@font-face{font-family:"Mali";font-style:normal;font-weight:400 700;font-display:swap;src:url("/assets/little-deck/fonts/Mali-Regular.woff2") format("woff2")}
@font-face{font-family:"Mali";font-style:italic;font-weight:400 700;font-display:swap;src:url("/assets/handwritten/fonts/mali/Mali-Italic.woff2") format("woff2")}
[hidden]{display:none!important}
html,body{height:100%;background:#13101b}
button{font-family:inherit;-webkit-tap-highlight-color:transparent}
button:focus-visible{outline:3px solid #ffcae0;outline-offset:4px}
.stage{padding:82px 14px 180px;isolation:isolate;background:radial-gradient(ellipse at 15% 20%,#4f293c70,transparent 50%),radial-gradient(ellipse at 85% 80%,#4e34404d,transparent 60%)}
.bg{inset:0;filter:blur(20px) saturate(.9);transform:scale(1.08);opacity:.32;transition:opacity .5s;contain:strict}
.frame-wrap{width:min(480px,90vw,calc((100dvh - 245px)*.8));max-height:none;min-width:0}
.frame{width:100%;height:auto;max-height:none;aspect-ratio:4/5;border-radius:20px;box-shadow:0 24px 65px #0007,0 0 0 1px #ffd8e622;background:#1a1420}
.frame .layer{will-change:transform,opacity;backface-visibility:hidden}
.fx-dissolve .layer{filter:none;transition:opacity .85s ease}
.fx-dissolve .layer.active{filter:none}
.fx-slide .layer{transform:translateX(calc(var(--direction,1)*22%))}
.fx-slide .layer.active{transform:translateX(0)}
.fx-slide .layer.exit{transform:translateX(calc(var(--direction,1)*-22%))}
.caption{border:0;text-align:left;color:#fff5f9;width:100%;pointer-events:auto;cursor:pointer;white-space:pre-line;overflow-wrap:anywhere;max-height:45%;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;padding:28px 24px 22px;line-height:1.55;background:linear-gradient(180deg,transparent,#130a16dc);text-shadow:0 1px 8px #0008;z-index:5}
.caption::after{content:" ↗";font:12px "Be Vietnam Pro",sans-serif;color:#ffc9df}
.caption:focus-visible{outline-offset:-5px}
.nav{pointer-events:none}
.nav button{pointer-events:auto;position:relative;touch-action:pan-y pinch-zoom}
.nav button::after{position:absolute;top:50%;width:38px;height:38px;display:grid;place-items:center;border:1px solid #fff5;border-radius:50%;background:#160e2099;backdrop-filter:blur(4px);font:24px system-ui;color:#fff;box-shadow:0 3px 15px #0003;transform:translateY(-50%);opacity:.8;transition:opacity .2s,background .2s}
#prev::after{content:"‹";left:10px}#next::after{content:"›";right:10px}
.nav button:hover::after{opacity:1;background:#503245bb}
.nav button:disabled{cursor:default}.nav button:disabled::after{display:none}
.nav button:focus-visible{outline-offset:-4px;z-index:6;border-radius:16px}
.progress{height:3px;top:12px;left:16px;right:16px}
.progress i::after{width:100%;transform:scaleX(0);transform-origin:left center}
.progress i.done::after{transform:scaleX(1)}
.progress i.on::after{width:100%;animation:memory-progress 8s linear forwards;transition:none}
@keyframes memory-progress{to{transform:scaleX(1)}}
.playback-bar{position:absolute;bottom:calc(126px + env(safe-area-inset-bottom,0px));left:50%;transform:translateX(-50%);z-index:8;display:flex;align-items:center;justify-content:center;gap:8px;width:max-content;max-width:94vw;color:#f0dce8;font-size:12px}
.playback-bar button{border:1px solid #ead1e62b;background:#221825a6;backdrop-filter:blur(8px);border-radius:999px;padding:9px 13px;min-height:38px;color:#f4e6ee;cursor:pointer;font-size:11px;white-space:nowrap}
.playback-bar button:hover{background:#483040b3;border-color:#ffd0e65c}
.playback-bar button:disabled{opacity:.5;cursor:default}
#photo-count{min-width:42px;text-align:center;font-size:11px;font-variant-numeric:tabular-nums;opacity:.8}
.toolbar{gap:3px;padding:6px;border-radius:22px;background:#1b1226b3;border-color:#ecd2e526;backdrop-filter:blur(10px);box-shadow:0 12px 36px #0004}
.toolbar button{min-height:47px;color:#eadbe6;font-weight:500}
.toolbar button.on{background:linear-gradient(150deg,#a35678,#764458);box-shadow:0 3px 12px #d266902e}
.hint,.stage.mode-gallery .hint,.stage.mode-album .hint{top:calc(66px + env(safe-area-inset-top,0px));max-width:92vw;white-space:normal;text-align:center;font-size:11px;line-height:1.5;background:none;backdrop-filter:none;color:#eedbe5bf;padding:0 8px;pointer-events:none}
.sig{bottom:calc(79px + env(safe-area-inset-bottom,0px));max-height:38px;overflow:auto;overflow-wrap:anywhere;white-space:pre-line;font-size:13px;line-height:1.5;width:min(600px,88vw);color:#f0c8d9;text-shadow:0 2px 16px #b85c8738}
.stage.mode-gallery .sig,.stage.mode-album .sig{bottom:calc(81px + env(safe-area-inset-bottom,0px))}
.gallery{padding:105px 16px calc(145px + env(safe-area-inset-bottom,0px));overscroll-behavior:contain;scroll-padding:105px 0 145px}
.gallery-grid{gap:18px;max-width:920px;grid-template-columns:repeat(auto-fill,minmax(155px,1fr))}
.gallery-item{padding:0;border-color:#e0b4cf2e;border-radius:14px;background:#231b29;box-shadow:0 8px 24px #0004;text-align:left}
.gallery-item span{font-family:"Mali","Be Vietnam Pro",sans-serif;font-size:13px;white-space:pre-line;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.gallery-item:hover img{transform:scale(1.035)}
.album{width:min(860px,94vw);height:min(560px,calc(100dvh - 245px))}
.album-book{overflow:visible;border-radius:6px 16px 16px 6px;box-shadow:0 22px 60px #0007,0 0 0 1px #e6d7ca44}
.album-page{min-width:0;overflow:hidden;padding-bottom:32px;gap:10px}
.album-shot{flex:1 1 auto;min-height:0;max-height:calc(100% - 70px);width:min(100%,280px)}
.album-shot img{object-position:center}
.album-cap{font:italic 500 clamp(12px,1.5vw,16px)/1.6 "Mali","Be Vietnam Pro",sans-serif;border:0;background:none;pointer-events:auto;cursor:pointer;color:#684353;min-height:36px;max-height:64px;overflow:hidden;overflow-wrap:anywhere;white-space:pre-line;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;z-index:5;padding:0 3px;flex:0 0 auto;text-align:center;width:100%}
.album-cap::after{content:" ↗";font:11px "Be Vietnam Pro",sans-serif;color:#915c72}
.album-nav{pointer-events:none}.album-nav button{pointer-events:auto;position:relative;touch-action:pan-y pinch-zoom}
.album-nav button::after{position:absolute;top:50%;width:34px;height:44px;display:grid;place-items:center;border-radius:99px;background:#563448a6;color:#fff;transform:translateY(-50%);font:26px system-ui;box-shadow:0 2px 12px #0002}
#albumPrev::after{content:"‹";left:7px}#albumNext::after{content:"›";right:7px}
.album-nav button:disabled{cursor:default}.album-nav button:disabled::after{opacity:.22}
.album-nav button:focus-visible{outline-offset:-4px;border-radius:14px}
.album-spine{pointer-events:none}
.stage.mode-cute .frame-wrap{width:min(410px,88vw,calc((100dvh - 245px)*.82));max-height:none;filter:none}
.stage.mode-cute .frame{max-height:none;border-radius:5px;box-shadow:0 22px 55px #0006}
.stage.mode-cute .caption{font:italic 500 clamp(12px,2.7vw,17px)/1.5 "Mali","Be Vietnam Pro",sans-serif;max-height:19.5%;min-height:0;text-shadow:none;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;align-content:center;padding:5px 10px 8px;width:90%;color:#674653}
.stage.mode-cute .caption::after{color:#a96986}
.stage.mode-cute .bg{filter:blur(20px) saturate(.95);opacity:.35}
.stage.mode-cute .nav button::after{width:30px;height:30px;font-size:21px;opacity:.7}
.stage.mode-cute .sig{font-size:13px}
.sticker{animation-duration:4.5s;filter:none;color:#c77e9c}
.spark{box-shadow:0 0 8px #ffc8e580;opacity:.55}.spark.heart{text-shadow:0 0 9px #eea3c859}.spark.petal{box-shadow:none;opacity:.65}
.is-motion-paused .progress i.on::after,.is-motion-paused .fx-kenburns .layer.active img,.is-motion-paused .spark,.is-motion-paused .sticker{animation-play-state:paused}
.is-hidden *{animation-play-state:paused!important;transition:none!important}
#memory-reader{position:fixed;inset:0;margin:auto;width:min(660px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid #e4b7d153;border-radius:20px;background:#211827;color:#fff1f8;box-shadow:0 25px 90px #0009;font-family:"Be Vietnam Pro",sans-serif;overflow:hidden}
#memory-reader::backdrop{background:#0d0813e8;backdrop-filter:blur(6px)}
#memory-reader[open]{display:flex;flex-direction:column}
.reader-header,.reader-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid #ead0e21f;flex-shrink:0}
.reader-header p{font-size:12px;color:#e5c8d9;padding-left:5px;font-variant-numeric:tabular-nums}
.reader-header button,.reader-footer button{border:1px solid #e7c8dd4d;background:#ffffff08;border-radius:999px;min-width:44px;min-height:44px;font:inherit;color:#f7e7f0;cursor:pointer}
.reader-header button{font-size:27px}.reader-footer{border-top:1px solid #ead0e21f;border-bottom:0}.reader-footer button{font-size:12px;padding:8px 18px}
.reader-footer button:disabled{opacity:.35;cursor:default}
#reader-body{padding:16px;overflow:auto;overscroll-behavior:contain;min-height:0}
#reader-photo{display:block;width:100%;max-height:55dvh;object-fit:contain;border-radius:10px;background:#150f1c}
#reader-caption{white-space:pre-wrap;overflow-wrap:anywhere;font:italic 500 clamp(16px,3.8vw,20px)/1.8 "Mali","Be Vietnam Pro",sans-serif;text-align:center;margin:18px 6px 8px;color:#f8e5ef}
@media(max-width:640px){.gallery-grid{gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}.album{width:min(360px,92vw);height:min(490px,calc(100dvh - 245px))}.album-page.right{padding:20px 25px 30px 32px;gap:9px}.album-shot{max-height:calc(100% - 65px)}.album-cap{font-size:14px;max-height:52px}.toolbar button{min-width:58px;font-size:10px;padding:6px 8px}.toolbar button .lbl{font-size:10px}.toolbar button .ico{width:18px;height:18px}.sig{font-size:12px}.stage.mode-cute .frame-wrap{transform:rotate(-.8deg)}.caption{font-size:clamp(14px,3.7vw,19px);padding:24px 20px 18px}.stage.mode-cute .caption{font-size:clamp(12px,3.1vw,16px)}.playback-bar button{font-size:10px;padding:8px 10px}.hint{font-size:10px}}
@media(max-width:359px){.toolbar button{min-width:55px;padding-inline:6px}.playback-bar{gap:5px}.playback-bar button{padding-inline:9px}.hint{font-size:9px}.album-page.right{padding-left:25px;padding-right:20px}}
@media(max-height:540px){.stage{padding-top:66px;padding-bottom:136px}.hint,.stage.mode-album .hint,.stage.mode-gallery .hint{top:60px;font-size:9px}.toolbar{bottom:calc(6px + env(safe-area-inset-bottom,0px));padding:3px 5px}.toolbar button{min-height:42px;padding:4px 8px}.toolbar button .ico{width:16px;height:16px}.sig,.stage.mode-album .sig,.stage.mode-gallery .sig{bottom:calc(63px + env(safe-area-inset-bottom,0px));max-height:28px;font-size:11px}.playback-bar{bottom:calc(99px + env(safe-area-inset-bottom,0px))}.playback-bar button{min-height:30px;padding:5px 10px;font-size:10px}.frame-wrap,.stage.mode-cute .frame-wrap{width:min(320px,85vw,calc((100dvh - 202px)*.8))}.album{height:calc(100dvh - 202px)}.album-page,.album-page.right{padding-block:12px 24px;gap:5px}.album-shot{max-height:calc(100% - 42px);border-width:6px!important}.album-cap{font-size:11px;line-height:1.4;max-height:34px;min-height:16px}.album-page-num{bottom:6px;font-size:9px}.caption{font-size:13px;padding:20px 16px 12px}.stage.mode-cute .caption{font-size:10px;padding:2px 6px}.gallery{padding-top:84px;padding-bottom:110px}}
@media(max-height:540px) and (min-width:641px){.frame-wrap{width:min(520px,70vw)}.frame{aspect-ratio:auto;height:calc(100dvh - 202px);min-height:130px}.frame .layer img{object-fit:contain}.caption{font-size:13px;max-height:42%;padding:20px 60px 10px}.album{width:min(650px,85vw)}.album-shot{width:auto;max-width:100%;aspect-ratio:4/3}.stage.mode-cute .frame-wrap{width:min(280px,45vw)}.stage.mode-cute .frame{height:calc(100dvh - 202px)}.stage.mode-cute .frame .layer{bottom:22%}.stage.mode-cute .caption{height:22%;max-height:22%;font-size:11px}.stage.mode-cute .frame .layer img{object-fit:contain}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.progress i.on::after{transform:scaleX(.4)}.bg{filter:none;opacity:.13}#memory-reader::backdrop{backdrop-filter:none}.sticker{transform:none}}

/* Keep instructions clear of the book on narrow/short screens. */
.hint,.stage.mode-gallery .hint,.stage.mode-album .hint{width:min(680px,90vw)}
@media(max-height:540px){.hint,.stage.mode-gallery .hint,.stage.mode-album .hint{display:none}}

