:root {
    --paper: #f6f3ea;
    --paper-bright: #fff9ee;
    --sage: #6f9993;
    --sage-soft: #c9d4be;
    --sage-pale: #dce5d5;
    --sage-deep: #395451;
    --ink: #395451;
    --muted: #879485;
    --line: rgba(57, 84, 81, 0.15);
    --gold: #d7b77a;
    --surface-card: rgba(255, 249, 238, 0.84);
    --surface-control: rgba(255, 249, 238, 0.58);
    --surface-control-hover: rgba(255, 249, 238, 0.78);
    --surface-control-active: rgba(220, 229, 213, 0.72);
    --surface-lifted: #fffdf7;
    --border-soft: rgba(57, 84, 81, 0.08);
    --border-faint: rgba(57, 84, 81, 0.06);
    --border-quiet: rgba(57, 84, 81, 0.025);
    --line-soft: rgba(111, 153, 147, 0.22);
    --text-secondary: rgba(57, 84, 81, 0.6);
    --text-tertiary: rgba(57, 84, 81, 0.56);
    --text-quiet: rgba(57, 84, 81, 0.5);
    --sage-action: #67948c;
    --sage-action-hover: #709c94;
    --sage-action-active: #5f8b83;
    --shadow-card: 0 15px 34px rgba(57, 84, 81, 0.065);
    --shadow-small: 0 3px 10px rgba(57, 84, 81, 0.035);
    --shadow-control: 0 6px 14px rgba(57, 84, 81, 0.07);
    --shadow-control-hover: 0 7px 16px rgba(57, 84, 81, 0.075);
    --shadow-control-pressed: 0 4px 9px rgba(57, 84, 81, 0.05);
    --shadow-nav: 0 -1px 8px rgba(57, 84, 81, 0.018);
    --shadow-lifted: 0 5px 14px rgba(57, 84, 81, 0.065);
    --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --display-font: "Iowan Old Style", Baskerville, "Times New Roman", "Songti SC", serif;
    --utility-font: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", "Microsoft YaHei", monospace;

    --shell-inline: clamp(16px, 5vw, 24px);
    --shell-top: clamp(12px, 2.3vh, 20px);
    --main-gap: clamp(10px, 2.3vh, 22px);
    --welcome-card-gap: clamp(10px, 1.7vh, 16px);
    --card-radius: clamp(17px, 4.5vw, 22px);
    --card-max-height: min(70vh, 600px);
    --card-padding-inline: clamp(14px, 4.5vw, 22px);
    --package-header-padding-block: clamp(21px, 3.2vh, 24px);
    --ticket-divider-height: clamp(24px, 3.6vh, 30px);
    --ticket-notch-size: clamp(14px, 3.8vw, 17px);
    --ticket-notch-radius: calc(var(--ticket-notch-size) * 0.5);
    --ticket-notch-center: calc(var(--package-header-padding-block) * 2 + var(--status-icon-size) + var(--ticket-divider-height) * 0.5 + 1px);
    --ticket-divider-line-inset: calc(var(--ticket-notch-radius) + 2px);
    --package-body-padding-bottom: clamp(18px, 2.8vh, 24px);
    --status-icon-size: clamp(34px, 8.8vw, 38px);
    /* Standard gift sizing stays width-driven so browser UI height changes do not resize it. */
    --gift-size: clamp(260px, 78vw, 326px);
    --gift-stage-gap: clamp(7px, 1.1vh, 12px);
    --prompt-size: clamp(13px, 3.5vw, 15px);
    --cta-height: clamp(46px, 5.7vh, 50px);
    --tab-inline-inset: 12px;
    --tab-bar-height: 60px;
    --tab-radius: 28px;
    --tab-bottom-gap: clamp(6px, 2vw, 10px);
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    min-width: 320px;
    background: var(--paper);
}

body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-width: 320px;
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 43%, rgba(255, 249, 238, 0.55), transparent 48%),
        var(--paper);
    color: var(--ink);
    font-family: var(--body-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overscroll-behavior: none;
}

body::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(57, 84, 81, 0.16) 0.45px, transparent 0.55px);
    background-size: 18px 18px;
    content: "";
    opacity: 0.11;
}

button {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.app-shell {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100%, 480px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0 auto;
    padding: var(--shell-top) var(--shell-inline) 0;
    padding-top: max(var(--shell-top), env(safe-area-inset-top));
    padding-bottom: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    transition: filter 420ms ease;
}

.welcome-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(14px, 4vw, 18px);
}

.welcome-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.welcome-title {
    margin: 0;
    color: var(--sage-deep);
    font-size: clamp(21px, 5.7vw, 27px);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.1;
    white-space: nowrap;
}

.welcome-sparkle {
    color: var(--gold);
    font-size: 0.64em;
    font-weight: 400;
    opacity: 0.86;
    vertical-align: 0.12em;
}

.welcome-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: clamp(12px, 3.35vw, 14.5px);
    letter-spacing: 0.02em;
    line-height: 1.35;
    white-space: nowrap;
}

.music-toggle {
    position: relative;
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-top: -2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sage-deep);
    cursor: pointer;
    place-items: center;
    transition: transform 180ms ease;
}

.music-toggle::before {
    position: absolute;
    inset: 4px;
    border: 1px solid var(--line-soft);
    border-radius: 50%;
    background: var(--surface-control);
    box-shadow: var(--shadow-small);
    content: "";
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.music-toggle:hover::before {
    border-color: rgba(111, 153, 147, 0.34);
    background: var(--surface-control-hover);
}

.music-toggle:active {
    transform: scale(0.98);
}

.music-toggle.is-on::before {
    border-color: rgba(111, 153, 147, 0.34);
    background: var(--surface-control-active);
}

.music-label {
    position: relative;
    z-index: 1;
    font-family: var(--display-font);
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
}

@keyframes music-note-spin {
    to {
        transform: rotate(360deg);
    }
}

.music-toggle.is-on .music-label {
    animation: music-note-spin 6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .music-toggle.is-on .music-label {
        animation: none;
    }
}

.app-main {
    display: grid;
    min-height: 0;
    padding-top: var(--welcome-card-gap);
    padding-bottom: var(--main-gap);
    place-items: center;
}

.package-card {
    position: relative;
    display: flex;
    width: 100%;
    height: min(100%, var(--card-max-height));
    min-height: 0;
    border: 1px solid var(--border-quiet);
    border-left-color: transparent;
    border-right-color: transparent;
    border-top-color: var(--border-soft);
    border-radius: var(--card-radius);
    background: var(--surface-card);
    box-shadow: var(--shadow-card);
    /* Cut the ticket notches from the card output so the page background shows through. */
    -webkit-mask-image:
        linear-gradient(#000 0 0),
        radial-gradient(circle at 0 var(--ticket-notch-center), transparent 0 var(--ticket-notch-radius), #000 calc(var(--ticket-notch-radius) + 1px)),
        radial-gradient(circle at 100% var(--ticket-notch-center), transparent 0 var(--ticket-notch-radius), #000 calc(var(--ticket-notch-radius) + 1px));
    -webkit-mask-composite: source-in, source-in;
    -webkit-mask-repeat: no-repeat;
    mask-image:
        linear-gradient(#000 0 0),
        radial-gradient(circle at 0 var(--ticket-notch-center), transparent 0 var(--ticket-notch-radius), #000 calc(var(--ticket-notch-radius) + 1px)),
        radial-gradient(circle at 100% var(--ticket-notch-center), transparent 0 var(--ticket-notch-radius), #000 calc(var(--ticket-notch-radius) + 1px));
    mask-composite: intersect, intersect;
    mask-repeat: no-repeat;
    flex-direction: column;
    overflow: visible;
}

.package-card::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    border: 1px solid rgba(57, 84, 81, 0.075);
    border-radius: inherit;
    content: "";
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 25%, rgba(0, 0, 0, 0.65) 45%, rgba(0, 0, 0, 0.2) 70%, transparent 95%);
    -webkit-mask-repeat: no-repeat;
    mask-image: linear-gradient(to bottom, #000 0%, #000 25%, rgba(0, 0, 0, 0.65) 45%, rgba(0, 0, 0, 0.2) 70%, transparent 95%);
    mask-repeat: no-repeat;
}

.package-header,
.ticket-divider,
.package-body {
    position: relative;
    z-index: 1;
}

.package-header {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: var(--status-icon-size) minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(8px, 2.3vw, 11px);
    padding: var(--package-header-padding-block) var(--card-padding-inline);
}

.status-icon {
    display: grid;
    width: var(--status-icon-size);
    height: var(--status-icon-size);
    border-radius: 50%;
    background: rgba(220, 229, 213, 0.78);
    color: var(--sage-deep);
    place-items: center;
}

.status-icon svg {
    width: 62%;
    height: 62%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25;
}

.status-copy {
    min-width: 0;
}

.status-copy h2 {
    margin: 0;
    color: var(--sage-deep);
    font-size: clamp(15px, 4vw, 18px);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

.status-copy p {
    margin: 2px 0 0;
    color: var(--text-tertiary);
    font-size: clamp(12px, 3.2vw, 14px);
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.status-heart {
    display: block;
    padding: 1px 0 0 4px;
    color: var(--text-quiet);
    font-family: var(--display-font);
    font-size: clamp(20px, 5.5vw, 24px);
    line-height: 1;
}

.ticket-divider {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    height: var(--ticket-divider-height);
    z-index: 2;
    isolation: isolate;
    align-items: center;
    justify-content: center;
}

.ticket-divider__line {
    position: absolute;
    top: 50%;
    right: var(--ticket-divider-line-inset);
    left: var(--ticket-divider-line-inset);
    z-index: 1;
    display: block;
    width: auto;
    height: 1px;
    background: repeating-linear-gradient(
        to right,
        var(--line-soft) 0 5px,
        transparent 5px 9px
    );
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%);
    -webkit-mask-repeat: no-repeat;
    mask-image: linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%);
    mask-repeat: no-repeat;
    transform: translateY(-50%);
}

.package-body {
    display: flex;
    min-height: 0;
    padding: 0 var(--card-padding-inline) var(--package-body-padding-bottom);
    flex: 1 1 auto;
    flex-direction: column;
}

.gift-stage {
    position: relative;
    display: grid;
    min-height: var(--gift-size);
    flex: 1 1 auto;
    padding: var(--gift-stage-gap) 0;
    place-items: center;
}

.gift-frame {
    position: relative;
    display: grid;
    width: min(var(--gift-size), 100%);
    height: var(--gift-size);
    flex: 0 0 auto;
    place-items: center;
    z-index: 1;
}

.gift-atmosphere {
    position: absolute;
    z-index: 0;
    inset: -5%;
    pointer-events: none;
}

.gift-atmosphere > span {
    position: absolute;
    display: block;
}

.gift-atmosphere__star {
    width: 9px;
    height: 9px;
    background: rgba(215, 183, 122, 0.7);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    opacity: 0.42;
    animation: atmosphere-twinkle 4.8s ease-in-out infinite;
}

.gift-atmosphere__star--one {
    top: 17%;
    left: 6%;
}

.gift-atmosphere__star--two {
    top: 28%;
    right: 5%;
    width: 7px;
    height: 7px;
    animation-delay: 1.6s;
}

.gift-atmosphere__paper {
    width: 10px;
    height: 4px;
    border-radius: 1px;
    background: var(--sage-soft);
    opacity: 0.68;
    animation: atmosphere-drift 5.4s ease-in-out infinite;
}

.gift-atmosphere__paper--one {
    top: 52%;
    left: 1%;
    --tilt: -24deg;
    transform: rotate(var(--tilt));
}

.gift-atmosphere__paper--two {
    right: 2%;
    bottom: 25%;
    width: 8px;
    height: 6px;
    --tilt: 28deg;
    transform: rotate(var(--tilt));
    animation-delay: 2.2s;
}

.gift-atmosphere__glow {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 249, 238, 0.72);
    filter: blur(3px);
    opacity: 0.32;
    animation: atmosphere-breathe 4.6s ease-in-out infinite;
}

.gift-atmosphere__glow--one {
    top: 14%;
    left: 36%;
}

.gift-atmosphere__glow--two {
    right: 28%;
    bottom: 13%;
    width: 10px;
    height: 10px;
    animation-delay: 1.8s;
}

.gift-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    animation: package-float 3.7s ease-in-out infinite;
    object-fit: contain;
    pointer-events: none;
    transform-origin: center bottom;
}

.gift-image.is-entering {
    animation: package-arrive 700ms cubic-bezier(0.22, 0.88, 0.28, 1) both;
}

.gift-image.is-shaking {
    animation: package-shake 360ms ease-in-out both;
}

.gift-image[hidden],
.gift-frame.is-failed .gift-image {
    display: none;
}

.gift-fallback {
    display: none;
    width: 72px;
    height: 72px;
    border: 1px solid rgba(111, 153, 147, 0.22);
    border-radius: 22px;
    background: rgba(220, 229, 213, 0.58);
    font-size: 34px;
    place-items: center;
}

.gift-frame.is-failed .gift-fallback {
    display: grid;
}

.package-button {
    position: relative;
    z-index: 1;
    display: grid;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    place-items: center;
}

.package-action {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
}

.package-prompt {
    flex: 0 0 auto;
    margin: 0 0 clamp(12px, 1.6vh, 16px);
    color: var(--text-secondary);
    font-size: var(--prompt-size);
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-align: center;
}

.accept-button {
    display: flex;
    width: min(72%, 280px);
    min-height: 44px;
    height: var(--cta-height);
    margin: 0 auto;
    padding: 8px 14px;
    align-items: center;
    justify-content: center;
    gap: clamp(17px, 4.8vw, 22px);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: var(--sage-action);
    box-shadow: var(--shadow-control);
    color: var(--paper-bright);
    cursor: pointer;
    font-size: clamp(15px, 3.8vw, 16px);
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1;
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.accept-button:hover {
    background: var(--sage-action-hover);
    box-shadow: var(--shadow-control-hover);
    transform: translateY(-1px);
}

.accept-button:active {
    background: var(--sage-action-active);
    box-shadow: var(--shadow-control-pressed);
    transform: scale(0.98);
}

.accept-button.is-processing {
    cursor: progress;
}

.accept-button.is-confirmed {
    background: var(--sage-deep);
}

.accept-arrow {
    font-family: var(--display-font);
    font-size: clamp(20px, 5.3vw, 22px);
    font-weight: 400;
    line-height: 0.75;
}

.bottom-nav-zone {
    display: flex;
    width: calc(100% + var(--shell-inline) + var(--shell-inline));
    min-height: 0;
    margin-left: calc(var(--shell-inline) * -1);
    padding-bottom: max(var(--tab-bottom-gap), env(safe-area-inset-bottom));
    align-items: flex-end;
}

.bottom-nav {
    display: grid;
    width: calc(100% - var(--tab-inline-inset) - var(--tab-inline-inset));
    height: var(--tab-bar-height);
    min-height: var(--tab-bar-height);
    margin-inline: var(--tab-inline-inset);
    border: 1px solid var(--border-faint);
    border-radius: var(--tab-radius);
    background: var(--paper-bright);
    box-shadow: var(--shadow-nav);
    grid-template-columns: repeat(3, 1fr);
}

.nav-item {
    position: relative;
    display: grid;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    place-items: center;
    transition: color 180ms ease, transform 180ms ease;
}

.nav-item svg {
    position: relative;
    z-index: 1;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.35;
    transition: color 180ms ease, transform 180ms ease;
}

.nav-item:hover svg {
    color: var(--sage-deep);
}

.nav-item--active::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    border: 1px solid var(--border-faint);
    border-radius: 25px;
    background: var(--surface-lifted);
    box-shadow: var(--shadow-lifted);
    content: "";
    transform: translate(-50%, calc(-50% - 6px));
}

.nav-item--active {
    color: var(--sage);
}

.nav-item--active svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.45;
    transform: translateY(-4px);
}

.nav-item:active {
    transform: scale(0.98);
}

@keyframes package-arrive {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes package-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

@keyframes package-shake {
    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-1.2deg);
    }

    50% {
        transform: rotate(1.2deg);
    }

    75% {
        transform: rotate(-0.6deg);
    }
}

@keyframes atmosphere-twinkle {
    0%,
    100% {
        opacity: 0.42;
    }

    50% {
        opacity: 0.72;
    }
}

@keyframes atmosphere-drift {
    0%,
    100% {
        transform: translateY(0) rotate(var(--tilt));
    }

    50% {
        transform: translateY(-2px) rotate(calc(var(--tilt) + 1deg));
    }
}

@keyframes atmosphere-breathe {
    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.38;
    }
}

@supports (height: 100dvh) {
    :root {
        --shell-top: clamp(12px, 2.3dvh, 20px);
        --main-gap: clamp(10px, 2.3dvh, 22px);
        --welcome-card-gap: clamp(10px, 1.7dvh, 16px);
        --card-max-height: min(70dvh, 600px);
        --package-header-padding-block: clamp(21px, 3.2dvh, 24px);
        --ticket-divider-height: clamp(24px, 3.6dvh, 30px);
        --package-body-padding-bottom: clamp(18px, 2.8dvh, 24px);
        --gift-size: clamp(260px, 78vw, 326px);
        --gift-stage-gap: clamp(7px, 1.1dvh, 12px);
        --cta-height: clamp(46px, 5.7dvh, 50px);
    }
}

@media (max-height: 680px) {
    :root {
        --shell-top: 10px;
        --main-gap: clamp(7px, 1.5vh, 12px);
        --welcome-card-gap: clamp(7px, 1.1vh, 9px);
        --card-max-height: min(70vh, 518px);
        --package-header-padding-block: clamp(14px, 2.4vh, 18px);
        --ticket-divider-height: 24px;
        --package-body-padding-bottom: 14px;
        --status-icon-size: 34px;
        /* Height selects compact mode; gift sizing remains width-driven within it. */
        --gift-size: clamp(245px, 72vw, 286px);
        --gift-stage-gap: 2px;
        --cta-height: clamp(46px, 6.2vh, 49px);
    }
}

@supports (height: 100dvh) {
    @media (max-height: 680px) {
        :root {
            --main-gap: clamp(7px, 1.5dvh, 12px);
            --welcome-card-gap: clamp(7px, 1.1dvh, 9px);
            --card-max-height: min(70dvh, 518px);
            --package-header-padding-block: clamp(14px, 2.4dvh, 18px);
            --package-body-padding-bottom: 14px;
            --cta-height: clamp(46px, 6.2dvh, 49px);
        }
    }
}

@media (max-height: 620px) {
    :root {
        --welcome-card-gap: clamp(6px, 1dvh, 8px);
        --card-max-height: min(70vh, 480px);
        --gift-size: clamp(220px, 66vw, 250px);
        --package-header-padding-block: 12px;
        --ticket-divider-height: 22px;
        --package-body-padding-bottom: 12px;
        --prompt-size: 12px;
        --cta-height: 46px;
    }
}

@supports (height: 100dvh) {
    @media (max-height: 620px) {
        :root {
            --welcome-card-gap: clamp(6px, 1dvh, 8px);
            --card-max-height: min(70dvh, 480px);
            --package-header-padding-block: 12px;
            --package-body-padding-bottom: 12px;
        }
    }
}

@media (min-height: 880px) and (max-width: 539px) {
    :root {
        --main-gap: clamp(12px, 2.4vh, 22px);
        --card-max-height: min(70vh, 600px);
    }
}

@supports (height: 100dvh) {
    @media (min-height: 880px) and (max-width: 539px) {
        :root {
            --main-gap: clamp(12px, 2.4dvh, 22px);
            --card-max-height: min(70dvh, 600px);
        }
    }
}

@media (min-width: 540px) {
    :root {
        --gift-size: clamp(260px, 34vw, 326px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .gift-image.is-entering,
    .gift-image.is-shaking {
        opacity: 1;
        transform: none;
    }
}

/* The Opening Scene is a quiet reveal layer; the homepage stays underneath as the frozen source state. */
.app-shell {
    transition: filter 420ms ease, opacity 560ms ease;
}

.app-shell.is-opening-exit {
    pointer-events: none;
    opacity: 0;
}

.app-shell.is-opening-exit .gift-frame {
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 560ms ease, transform 560ms ease;
}

.opening-scene {
    --opening-cream: #fff9ee;
    --opening-cream-muted: rgba(255, 249, 238, 0.72);
    --opening-gold: #e6c786;
    --opening-sage: #b9d2b5;
    --opening-sage-deep: #405b48;
    position: fixed;
    z-index: 20;
    inset: 0;
    overflow: hidden;
    background: #698e87;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 560ms ease, visibility 0s linear 560ms;
}

.opening-scene.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.opening-background {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 43%, rgba(255, 230, 176, 0.15), transparent 24%),
        linear-gradient(180deg, #7ca099 0%, #6c918a 52%, #5e8079 100%);
    opacity: 0;
    transition: opacity 650ms ease;
}

.opening-scene.is-visible .opening-background {
    opacity: 1;
}

.opening-scene__inner {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100%, 480px);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    grid-template-rows: minmax(0, 1fr) auto;
}

.opening-scene__content {
    display: flex;
    min-height: 0;
    padding: max(18px, env(safe-area-inset-top)) var(--shell-inline) clamp(6px, 1.2vh, 12px);
    align-items: center;
    flex-direction: column;
}

.opening-progress {
    display: flex;
    width: min(100%, 302px);
    flex: 0 0 auto;
    align-items: flex-start;
}

.opening-step {
    display: grid;
    width: 48px;
    flex: 0 0 48px;
    gap: 6px;
    justify-items: center;
    color: rgba(255, 249, 238, 0.42);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    transition: color 260ms ease;
}

.opening-step__node {
    display: grid;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 249, 238, 0.48);
    border-radius: 50%;
    place-items: center;
    transition: background-color 260ms ease, border-color 260ms ease, box-shadow 260ms ease, color 260ms ease;
}

.opening-step__check {
    color: var(--opening-sage-deep);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    transform: scale(0.72);
    transition: opacity 220ms ease, transform 220ms ease;
}

.opening-step[data-state="active"] {
    color: var(--opening-cream);
}

.opening-step[data-state="active"] .opening-step__node {
    border-color: var(--opening-cream);
    background: var(--opening-cream);
    box-shadow: 0 0 0 4px rgba(255, 249, 238, 0.1);
}

.opening-step[data-state="completed"] {
    color: var(--opening-cream-muted);
}

.opening-step[data-state="completed"] .opening-step__node {
    border-color: var(--opening-gold);
    background: var(--opening-gold);
}

.opening-step[data-state="completed"] .opening-step__check {
    opacity: 1;
    transform: scale(1);
}

.opening-progress__connector {
    display: block;
    height: 1px;
    margin: 9px 6px 0;
    background: rgba(255, 249, 238, 0.25);
    flex: 1 1 auto;
    transition: background-color 300ms ease;
}

.opening-progress__connector[data-state="completed"] {
    background: rgba(230, 199, 134, 0.72);
}

.opening-copy {
    width: 100%;
    margin-top: clamp(15px, 2.7vh, 25px);
    flex: 0 0 auto;
    text-align: center;
}

.opening-title {
    margin: 0;
    color: var(--opening-cream);
    font-size: clamp(20px, 5.3vw, 26px);
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.25;
}

.opening-title:focus {
    outline: none;
}

.opening-subtitle {
    margin: 8px 0 0;
    color: rgba(255, 249, 238, 0.7);
    font-size: clamp(12px, 3.35vw, 14px);
    letter-spacing: 0;
    line-height: 1.45;
}

.opening-stage {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 0;
    margin: clamp(4px, 1vh, 12px) 0 clamp(2px, 0.9vh, 8px);
    flex: 1 1 auto;
    place-items: center;
}

.opening-gift {
    position: relative;
    z-index: 2;
    display: block;
    width: clamp(290px, 88vw, 430px);
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    transition: opacity 650ms cubic-bezier(0.22, 0.78, 0.28, 1), transform 650ms cubic-bezier(0.22, 0.78, 0.28, 1);
}

.opening-scene.is-artwork-visible .opening-gift {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.opening-glow {
    position: absolute;
    top: 52%;
    left: 50%;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.94);
    transition: opacity 650ms ease, transform 650ms cubic-bezier(0.22, 0.78, 0.28, 1);
}

.opening-glow--ambient {
    z-index: 0;
    width: 92%;
    height: 42%;
    background: radial-gradient(ellipse, rgba(255, 248, 226, 0.96) 0%, rgba(255, 238, 200, 0.56) 38%, rgba(255, 230, 178, 0.17) 63%, transparent 81%);
    filter: blur(18px);
}

.opening-glow--card {
    z-index: 3;
    width: 62%;
    height: 30%;
    background: radial-gradient(ellipse, rgba(255, 250, 231, 0.98) 0%, rgba(255, 238, 197, 0.58) 42%, rgba(255, 226, 169, 0.16) 67%, transparent 82%);
    filter: blur(13px);
}

.opening-scene.is-artwork-visible .opening-glow--ambient {
    opacity: 0.78;
    transform: translate(-50%, -50%) scale(1);
}

.opening-scene.is-artwork-visible .opening-glow--card {
    opacity: 0.46;
    transform: translate(-50%, -50%) scale(1);
}

.opening-sparkles {
    position: absolute;
    z-index: 3;
    inset: 0;
    opacity: 1;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.opening-sparkle {
    position: absolute;
    display: block;
    width: 7px;
    height: 7px;
    background: var(--opening-gold);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    opacity: 0;
}

.opening-sparkle--one {
    top: 23%;
    left: 14%;
}

.opening-sparkle--two {
    top: 29%;
    right: 12%;
    width: 6px;
    height: 6px;
}

.opening-sparkle--three {
    top: 54%;
    left: 8%;
    width: 5px;
    height: 5px;
}

.opening-sparkle--four {
    top: 65%;
    right: 10%;
    width: 5px;
    height: 5px;
}

.opening-sparkle--five {
    top: 43%;
    right: 25%;
    width: 6px;
    height: 6px;
}

.opening-scene.is-artwork-visible .opening-sparkle {
    animation: opening-sparkle-breathe 3.2s ease-in-out infinite;
}

.opening-scene.is-artwork-visible .opening-sparkle--one {
    animation-delay: 320ms;
}

.opening-scene.is-artwork-visible .opening-sparkle--two {
    animation-delay: 1.12s;
}

.opening-scene.is-artwork-visible .opening-sparkle--three {
    animation-delay: 1.86s;
}

.opening-scene.is-artwork-visible .opening-sparkle--four {
    animation-delay: 2.38s;
}

.opening-scene.is-artwork-visible .opening-sparkle--five {
    animation-delay: 740ms;
}

.opening-scene.is-card-reading .opening-sparkles {
    opacity: 0.48;
}

.opening-scene.is-unlocking .opening-sparkles {
    opacity: 0.6;
}

.opening-scene.is-unlock-complete .opening-sparkles,
.opening-scene.is-complete .opening-sparkles {
    opacity: 0.52;
}

.unlock-particle {
    position: fixed;
    z-index: 20;
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--opening-gold);
    box-shadow: 0 0 0 3px rgba(230, 199, 134, 0.12), 0 0 14px rgba(255, 221, 145, 0.78);
    opacity: 0;
    pointer-events: none;
}

.unlock-particle[hidden] {
    display: none;
}

.opening-hint {
    position: absolute;
    z-index: 7;
    left: 50%;
    bottom: calc(max(var(--tab-bottom-gap), env(safe-area-inset-bottom)) + var(--tab-bar-height) + 20px);
    display: grid;
    width: max-content;
    margin: 0;
    gap: 1px;
    justify-items: center;
    color: rgba(255, 249, 238, 0.62);
    font-size: 12px;
    letter-spacing: 0;
    line-height: 15px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 5px);
    transition: opacity 360ms ease, transform 360ms ease, visibility 0s linear 360ms;
}

.opening-hint__arrow {
    font-size: 13px;
    line-height: 12px;
}

.opening-scene.is-hint-visible .opening-hint {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0s;
}

.opening-bottom-nav-zone {
    position: relative;
    z-index: 5;
    width: 100%;
    margin-left: 0;
    padding-bottom: max(var(--tab-bottom-gap), env(safe-area-inset-bottom));
}

.opening-bottom-nav-zone .bottom-nav {
    width: calc(100% - var(--tab-inline-inset) - var(--tab-inline-inset));
    margin-inline: var(--tab-inline-inset);
    background: rgba(255, 249, 238, 0.94);
}

.opening-scene .nav-item {
    color: rgba(57, 84, 81, 0.42);
}

.opening-scene .nav-item:not(#openingGiftTab) {
    pointer-events: none;
}

.opening-scene .nav-item--active {
    color: rgba(57, 84, 81, 0.58);
}

.opening-nav-item--locked {
    opacity: 0.48;
    pointer-events: none;
}

.opening-nav-item--unlocked {
    color: var(--sage) !important;
    opacity: 1;
    pointer-events: auto;
}

.opening-scene.is-unlock-complete .opening-nav-item--unlocked {
    animation: opening-tab-unlock 720ms cubic-bezier(0.22, 0.78, 0.28, 1) both;
}

@keyframes opening-sparkle-breathe {
    0%,
    100% {
        opacity: 0.16;
        transform: translateY(0) scale(0.86);
    }

    50% {
        opacity: 0.72;
        transform: translateY(-7px) scale(1);
    }
}

@keyframes opening-tab-unlock {
    0% {
        filter: drop-shadow(0 0 0 rgba(230, 199, 134, 0));
        transform: translateY(-4px) scale(1);
    }

    44% {
        filter: drop-shadow(0 0 10px rgba(230, 199, 134, 0.48));
        transform: translateY(-7px) scale(1.02);
    }

    100% {
        filter: drop-shadow(0 0 0 rgba(230, 199, 134, 0));
        transform: translateY(-4px) scale(1);
    }
}

@media (max-height: 680px) {
    .opening-scene__content {
        padding-top: max(12px, env(safe-area-inset-top));
    }

    .opening-copy {
        margin-top: 12px;
    }

    .opening-stage {
        margin-top: 3px;
        margin-bottom: 1px;
    }

    .opening-gift {
        width: clamp(270px, 84vw, 340px);
    }
}

@media (max-height: 560px) {
    .opening-scene__content {
        padding-top: max(9px, env(safe-area-inset-top));
        padding-bottom: 3px;
    }

    .opening-step {
        gap: 4px;
        font-size: 10px;
    }

    .opening-step__node {
        width: 16px;
        height: 16px;
    }

    .opening-progress__connector {
        margin-top: 8px;
    }

    .opening-copy {
        margin-top: 8px;
    }

    .opening-subtitle {
        margin-top: 4px;
        font-size: 11px;
    }

    .opening-gift {
        width: clamp(230px, 76vw, 290px);
    }
}

@media (min-width: 540px) {
    .opening-gift {
        width: clamp(290px, 42vw, 430px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell.is-opening-exit .gift-frame {
        transform: none;
    }

    .opening-gift,
    .opening-scene.is-artwork-visible .opening-gift {
        transform: none;
    }

    .opening-glow,
    .opening-sparkle {
        animation: none !important;
    }
}

/* Opening Scene v2: the base artwork and both card faces share one relative composition. */
.opening-composition {
    position: relative;
    display: block;
    width: clamp(248px, 78vw, 330px);
    max-width: 100%;
    aspect-ratio: 2 / 3;
    flex: 0 0 auto;
}

.opening-gift.opening-gift-base {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    aspect-ratio: 2 / 3;
    object-fit: contain;
    transform: translateY(10px) scale(0.97);
}

.opening-scene.is-artwork-visible .opening-gift.opening-gift-base {
    transform: translateY(0) scale(1);
}

.opening-composition .opening-card-motion {
    position: absolute;
    z-index: 4;
    inset: 0;
    pointer-events: none;
    transform: translateY(0);
    transform-origin: 50% 52%;
}

.opening-composition .opening-card-scale {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transform: scale(1);
    transform-origin: 50% 52%;
}

.opening-composition .opening-card-flipper {
    position: absolute;
    inset: 0;
    perspective: 760px;
    transform: rotateY(0deg);
    transform-origin: 50% 52%;
    transform-style: preserve-3d;
    pointer-events: none;
    transition: transform 650ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.opening-card {
    position: absolute;
    top: 52%;
    left: 50%;
    display: block;
    max-width: none;
    height: auto;
    object-fit: contain;
    backface-visibility: hidden;
    pointer-events: none;
    translate: -50% -50%;
    transform-origin: center center;
    transform-style: preserve-3d;
}

.opening-heart-card {
    width: 100%;
    opacity: 0;
    transform: rotateY(0deg);
    transition: opacity 650ms ease;
}

.opening-for-you-card {
    width: 147%;
    opacity: 1;
    visibility: visible;
    transform: rotateY(180deg);
}

.opening-scene.is-artwork-visible .opening-heart-card {
    opacity: 1;
}

.opening-scene.is-heart-visible .opening-card-motion {
    transition: none;
}

.opening-scene.is-heart-visible .opening-card-scale {
    transition: none;
}

.opening-scene.is-heart-focused .opening-card-scale {
    transform: scale(1.055);
    transition: none;
}

.opening-scene.is-card-flipped .opening-heart-card {
    opacity: 0;
    transition: opacity 120ms ease 300ms;
}

.opening-scene.is-card-flipped .opening-card-flipper {
    transform: rotateY(180deg);
}

.opening-scene.is-card-settled .opening-card-motion {
    transform: translateY(-14px);
    transition: transform 220ms cubic-bezier(0.22, 0.78, 0.28, 1);
}

.opening-scene.is-card-settled .opening-card-scale {
    transform: scale(1);
    transition: transform 220ms cubic-bezier(0.22, 0.78, 0.28, 1);
}

.opening-scene.is-heart-visible .opening-glow--card {
    opacity: 0.51;
    transform: translate(-50%, -50%) scale(1.035);
    transition-duration: 180ms;
}

.opening-scene.is-heart-focusing .opening-glow--card,
.opening-scene.is-heart-focused .opening-glow--card {
    opacity: 0.56;
    transform: translate(-50%, -50%) scale(1.075);
    transition-duration: 260ms;
}

.opening-scene.is-card-flipped .opening-glow--card {
    opacity: 0.62;
    transform: translate(-50%, -50%) scale(1.11);
    transition-duration: 650ms;
}

.opening-scene.is-card-reading .opening-glow--ambient {
    opacity: 0.75;
}

.opening-scene.is-card-reading .opening-glow--card {
    opacity: 0.57;
    transform: translate(-50%, -50%) scale(1.08);
    transition-duration: 220ms;
}

.opening-scene.is-unlocking .opening-glow--ambient {
    opacity: 0.84;
    transform: translate(-50%, -50%) scale(1.025);
    transition-duration: 300ms;
}

.opening-scene.is-unlocking .opening-glow--card {
    opacity: 0.64;
    transform: translate(-50%, -50%) scale(1.1);
    transition-duration: 300ms;
}

.opening-scene.is-unlock-complete .opening-glow--ambient,
.opening-scene.is-complete .opening-glow--ambient {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(1);
    transition-duration: 300ms;
}

.opening-scene.is-unlock-complete .opening-glow--card,
.opening-scene.is-complete .opening-glow--card {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.055);
    transition-duration: 300ms;
}

@media (max-height: 680px) {
    .opening-composition {
        width: clamp(226px, 70vw, 300px);
    }
}

@media (max-height: 560px) {
    .opening-composition {
        width: clamp(210px, 64vw, 268px);
    }
}

@media (min-width: 540px) {
    .opening-composition {
        width: clamp(280px, 32vw, 330px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell {
        transition: filter 80ms ease, opacity 101ms ease !important;
    }

    .app-shell.is-opening-exit .gift-frame {
        transform: none !important;
        transition: opacity 101ms ease, transform 101ms ease !important;
    }

    .opening-scene {
        transition: opacity 101ms ease, visibility 0s linear 101ms !important;
    }

    .opening-scene.is-visible {
        transition-delay: 0s !important;
    }

    .opening-scene .opening-background {
        transition: opacity 117ms ease !important;
    }

    .opening-scene .opening-step,
    .opening-scene .opening-step__node,
    .opening-scene .opening-step__check,
    .opening-scene .opening-progress__connector {
        transition-duration: 60ms !important;
    }

    .opening-scene .opening-gift.opening-gift-base {
        transform: none !important;
        transition: opacity 117ms ease, transform 117ms ease !important;
    }

    .opening-scene .opening-card-motion {
        transform: translateY(0);
        transition: transform 117ms ease !important;
    }

    .opening-scene .opening-card-scale {
        transform: scale(1);
        transition: transform 117ms ease !important;
    }

    .opening-scene.is-heart-visible .opening-card-motion,
    .opening-scene.is-heart-visible .opening-card-scale {
        transition: none !important;
    }

    .opening-scene.is-heart-focused .opening-card-scale {
        transform: scale(1.025);
        transition: none !important;
    }

    .opening-scene.is-card-flipped .opening-heart-card {
        transition: opacity 40ms ease 55ms !important;
    }

    .opening-scene .opening-card-flipper {
        transition: transform 117ms ease !important;
    }

    .opening-scene.is-card-flipped .opening-card-flipper {
        transform: rotateY(180deg);
    }

    .opening-scene.is-card-settled .opening-card-motion {
        transform: translateY(-7px);
        transition: transform 40ms ease !important;
    }

    .opening-scene.is-card-settled .opening-card-scale {
        transform: scale(1);
        transition: transform 40ms ease !important;
    }

    .opening-scene .opening-glow {
        transition: opacity 117ms ease, transform 117ms ease !important;
    }

    .opening-scene.is-artwork-visible .opening-sparkle {
        animation: none !important;
        opacity: 0.22;
        transform: none;
    }

    .opening-scene.is-card-reading .opening-sparkles {
        opacity: 0.4;
    }

    .opening-scene .opening-hint {
        transition: opacity 80ms ease, transform 80ms ease, visibility 0s linear 80ms !important;
    }

    .opening-scene.is-hint-visible .opening-hint {
        transition-delay: 0s !important;
    }

    .opening-scene.is-unlock-complete .opening-nav-item--unlocked {
        animation-duration: 130ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Gift Hub: a standalone scrollable scene entered after the Opening Scene. */
.opening-scene.is-gift-hub-exit {
    opacity: 0;
    pointer-events: none;
}

.gift-hub-scene {
    --gift-hub-paper: #f7f3e8;
    --gift-hub-card-sage: #e6ead9;
    --gift-hub-card-cream: #fff1d5;
    --gift-hub-featured: #85aba5;
    --gift-hub-featured-deep: #6c928c;
    position: fixed;
    z-index: 30;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 7%, rgba(255, 250, 234, 0.9), transparent 28%),
        radial-gradient(circle at 10% 42%, rgba(220, 229, 213, 0.24), transparent 36%),
        var(--gift-hub-paper);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 420ms ease, visibility 0s linear 420ms;
}

.gift-hub-scene::before {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(57, 84, 81, 0.14) 0.45px, transparent 0.55px);
    background-size: 17px 17px;
    content: "";
    opacity: 0.085;
    pointer-events: none;
}

.gift-hub-scene.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.gift-hub-scene__inner {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100%, 480px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0 auto;
    grid-template-rows: minmax(0, 1fr) auto;
}

.gift-hub-scroll {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.gift-hub-scroll::-webkit-scrollbar {
    display: none;
}

.gift-hub {
    width: 100%;
    padding: max(clamp(14px, 2.2vh, 20px), env(safe-area-inset-top)) clamp(18px, 5.4vw, 26px) 22px;
}

.gift-hub__header {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.gift-hub__welcome {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.gift-hub__title {
    margin: 0;
    color: var(--sage-deep);
    font-size: clamp(20px, 5.55vw, 25px);
    font-weight: 650;
    letter-spacing: 0.035em;
    line-height: 1.2;
}

.gift-hub__title:focus {
    outline: none;
}

.gift-hub__subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: clamp(12px, 3.25vw, 14px);
    letter-spacing: 0.025em;
    line-height: 1.4;
}

.gift-hub__music-slot {
    display: grid;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    place-items: center;
}

.gift-hub__music-control {
    margin-top: 0;
}

.gift-entry {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.gift-entry:active,
.gift-entry.is-pressed {
    transform: scale(0.985);
}

.gift-featured {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 142px;
    margin: 17px 0 15px;
    padding: 18px 21px;
    border: 1px solid rgba(57, 84, 81, 0.08);
    border-radius: 20px;
    overflow: hidden;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.1), transparent 55%),
        var(--gift-hub-featured);
    box-shadow: 0 9px 18px rgba(57, 84, 81, 0.13), 0 2px 5px rgba(57, 84, 81, 0.08);
    color: var(--paper-bright);
    cursor: pointer;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    text-align: left;
}

.gift-featured__art {
    position: relative;
    z-index: 1;
    display: grid;
    width: 76px;
    height: 76px;
    border: 1px solid rgba(255, 249, 238, 0.38);
    border-radius: 20px 20px 18px 18px;
    background: rgba(255, 249, 238, 0.78);
    box-shadow: 0 5px 10px rgba(57, 84, 81, 0.14);
    color: #d0ad64;
    place-items: center;
    transform: rotate(-2deg);
}

.gift-featured__art svg {
    width: 58px;
    height: 58px;
    fill: rgba(215, 183, 122, 0.18);
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.gift-featured__content {
    position: relative;
    z-index: 2;
    display: grid;
    min-width: 0;
    justify-items: start;
}

.gift-featured__eyebrow {
    margin-bottom: 5px;
    color: rgba(255, 249, 238, 0.68);
    font-family: var(--utility-font);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.2;
}

.gift-featured__title {
    color: #fffaf0;
    font-size: clamp(17px, 4.55vw, 20px);
    font-weight: 650;
    letter-spacing: 0.035em;
    line-height: 1.25;
}

.gift-featured__subtitle {
    margin-top: 4px;
    color: rgba(255, 249, 238, 0.74);
    font-size: clamp(11px, 2.95vw, 12.5px);
    line-height: 1.35;
}

.gift-featured__cta {
    display: inline-flex;
    min-height: 28px;
    margin-top: 11px;
    padding: 5px 13px;
    border: 1px solid rgba(255, 249, 238, 0.5);
    border-radius: 999px;
    align-items: center;
    gap: 7px;
    background: rgba(255, 253, 247, 0.93);
    color: var(--gift-hub-featured-deep);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1;
}

.gift-featured__leaf {
    position: absolute;
    right: -13px;
    bottom: -19px;
    width: 102px;
    height: 102px;
    border: solid rgba(57, 84, 81, 0.12);
    border-width: 0 0 2px 2px;
    border-radius: 0 0 0 80%;
    transform: rotate(-15deg);
}

.gift-featured__leaf::before,
.gift-featured__leaf::after {
    position: absolute;
    width: 28px;
    height: 13px;
    border-radius: 100% 0 100% 0;
    background: rgba(57, 84, 81, 0.08);
    content: "";
}

.gift-featured__leaf::before {
    top: 29px;
    left: 21px;
    transform: rotate(22deg);
}

.gift-featured__leaf::after {
    top: 54px;
    left: 45px;
    transform: rotate(-5deg) scale(0.82);
}

.gift-list {
    display: grid;
    gap: 12px;
}

.gift-card {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 91px;
    padding: 12px 15px;
    border: 1px solid rgba(57, 84, 81, 0.055);
    border-radius: 19px;
    box-shadow: 0 6px 13px rgba(57, 84, 81, 0.09), 0 1px 3px rgba(57, 84, 81, 0.055);
    color: var(--ink);
    cursor: pointer;
    grid-template-columns: 62px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 13px;
    text-align: left;
}

.gift-card--sage {
    background: linear-gradient(105deg, rgba(255, 255, 255, 0.12), transparent 62%), var(--gift-hub-card-sage);
}

.gift-card--cream {
    background: linear-gradient(105deg, rgba(255, 255, 255, 0.15), transparent 62%), var(--gift-hub-card-cream);
}

.gift-card__icon {
    display: grid;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(215, 183, 122, 0.22);
    border-radius: 15px;
    background: rgba(255, 253, 247, 0.75);
    box-shadow: 0 4px 9px rgba(57, 84, 81, 0.075);
    color: #b99a60;
    place-items: center;
    transform: rotate(-1deg);
}

.gift-card__icon svg {
    width: 47px;
    height: 47px;
    fill: rgba(215, 183, 122, 0.12);
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.55;
}

.gift-card__content {
    display: grid;
    min-width: 0;
    align-content: center;
}

.gift-card__index {
    margin-bottom: 3px;
    color: rgba(57, 84, 81, 0.42);
    font-family: var(--utility-font);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1;
}

.gift-card__title {
    overflow: hidden;
    color: var(--sage-deep);
    font-size: clamp(14.5px, 3.85vw, 17px);
    font-weight: 650;
    letter-spacing: 0.01em;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gift-card__subtitle {
    overflow: hidden;
    margin-top: 5px;
    color: rgba(57, 84, 81, 0.58);
    font-size: clamp(10.5px, 2.8vw, 12px);
    letter-spacing: 0.015em;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gift-card__arrow {
    color: rgba(57, 84, 81, 0.68);
    font-family: var(--display-font);
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    transform: translateY(-1px);
}

.gift-hub-bottom-nav-zone {
    position: relative;
    z-index: 5;
    width: 100%;
    margin-left: 0;
    padding-bottom: max(var(--tab-bottom-gap), env(safe-area-inset-bottom));
}

.gift-hub-bottom-nav-zone::before {
    position: absolute;
    z-index: -1;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(var(--tab-bar-height) + max(var(--tab-bottom-gap), env(safe-area-inset-bottom)) + 18px);
    background: linear-gradient(to top, var(--gift-hub-paper) 72%, rgba(247, 243, 232, 0));
    content: "";
    pointer-events: none;
}

.gift-hub-bottom-nav-zone .bottom-nav {
    background: rgba(255, 251, 241, 0.95);
}

.gift-hub-bottom-nav-zone .nav-item[aria-disabled="true"] {
    cursor: default;
    pointer-events: none;
}

@media (max-width: 359px) {
    .gift-hub {
        padding-inline: 15px;
    }

    .gift-hub__music-slot {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .gift-featured {
        padding-inline: 15px;
        grid-template-columns: 66px minmax(0, 1fr);
        gap: 13px;
    }

    .gift-featured__art {
        width: 66px;
        height: 66px;
    }

    .gift-card {
        grid-template-columns: 56px minmax(0, 1fr) 17px;
        gap: 10px;
    }

    .gift-card__icon {
        width: 54px;
        height: 54px;
    }
}

@media (max-height: 774px) {
    .gift-hub {
        padding-bottom: 18px;
    }

    .gift-featured {
        margin-top: 10px;
    }
}

@media (min-width: 540px) {
    .gift-hub-scene__inner {
        border-right: 1px solid rgba(57, 84, 81, 0.05);
        border-left: 1px solid rgba(57, 84, 81, 0.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .opening-scene.is-gift-hub-exit,
    .gift-hub-scene {
        transition-duration: 101ms !important;
    }

    .gift-entry:active,
    .gift-entry.is-pressed {
        transform: none;
    }
}

/* Gift Detail: reusable second-level scene shell. */
.gift-hub-scene.is-detail-transition {
    transition: opacity 260ms ease, visibility 0s linear 260ms;
}

.gift-hub-scene.is-detail-transition.is-visible {
    transition-delay: 0s;
}

.gift-hub-scene__inner {
    transform: scale(1);
    transform-origin: center center;
    transition: transform 260ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.gift-hub-scene.is-detail-background {
    opacity: 0;
    pointer-events: none;
}

.gift-hub-scene.is-detail-background .gift-hub-scene__inner {
    transform: scale(0.99);
}

.gift-detail-scene {
    --detail-paper: #f7f3e9;
    --detail-cream: #fff4dd;
    --detail-sage-pale: #edf0e4;
    --detail-pass: #adbd97;
    --detail-pass-deep: #92a77f;
    --detail-gold: #c4a05b;
    position: fixed;
    z-index: 40;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 48% 8%, rgba(255, 253, 247, 0.96), transparent 28%),
        radial-gradient(circle at 91% 44%, rgba(220, 229, 213, 0.18), transparent 34%),
        var(--detail-paper);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 260ms ease, visibility 0s linear 260ms;
}

.gift-detail-scene::before {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(57, 84, 81, 0.13) 0.42px, transparent 0.54px);
    background-size: 17px 17px;
    content: "";
    opacity: 0.075;
    pointer-events: none;
}

.gift-detail-scene.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.gift-detail-scene__surface {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    transform: scale(1.01);
    transform-origin: center center;
    transition: transform 260ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.gift-detail-scene.is-visible .gift-detail-scene__surface {
    transform: scale(1);
}

.gift-detail-scroll {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.gift-detail-scroll::-webkit-scrollbar {
    display: none;
}

.gift-detail {
    width: 100%;
    min-height: 100%;
    padding: 0 clamp(18px, 5.4vw, 26px) max(34px, env(safe-area-inset-bottom));
}

.gift-detail__header {
    display: grid;
    min-height: 93px;
    padding-top: max(1px, env(safe-area-inset-top));
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 10px;
}

.gift-detail__back {
    display: grid;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(57, 84, 81, 0.055);
    border-radius: 50%;
    background: rgba(255, 253, 247, 0.86);
    box-shadow: 0 6px 15px rgba(57, 84, 81, 0.09);
    color: var(--sage-deep);
    cursor: pointer;
    place-items: center;
    transition: background-color 130ms ease, box-shadow 130ms ease, transform 130ms ease;
}

.gift-detail__back:active {
    background: rgba(237, 240, 228, 0.9);
    box-shadow: 0 3px 8px rgba(57, 84, 81, 0.07);
    transform: scale(0.97);
}

.gift-detail__back svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.gift-detail__heading {
    display: grid;
    min-width: 0;
    gap: 5px;
    text-align: center;
}

.gift-detail__eyebrow {
    margin: 0;
    color: var(--sage-deep);
    font-family: var(--utility-font);
    font-size: clamp(15px, 4.2vw, 18px);
    font-weight: 700;
    letter-spacing: 0.065em;
    line-height: 1.15;
}

.gift-detail__title {
    overflow: hidden;
    margin: 0;
    color: rgba(57, 84, 81, 0.78);
    font-size: clamp(13px, 3.55vw, 15px);
    font-weight: 500;
    letter-spacing: 0.055em;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gift-detail__title:focus {
    outline: none;
}

.gift-detail__header-spacer {
    width: 46px;
    height: 46px;
}

.gift-detail__music-control {
    justify-self: center;
    margin-top: 0;
}

.gift-detail__body,
.rights-detail,
.guide-detail,
.egg-detail,
.memory-detail,
.note-detail {
    width: 100%;
}

/* Gift 05: the last object in the journey is deliberately only one quiet sheet. */
.note-detail {
    --note-ink: #395451;
    --note-gold: #c5a25d;
    min-height: calc(100dvh - 93px - max(34px, env(safe-area-inset-bottom)));
    color: var(--note-ink);
}

.note-detail__intro {
    display: grid;
    grid-template-columns: 5px auto 5px;
    align-items: center;
    justify-content: center;
    gap: 17px;
    padding-top: clamp(22px, 4.2vh, 38px);
}

.note-detail__intro h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", var(--display-font), serif;
    font-size: clamp(14px, 4vw, 17px);
    font-weight: 500;
    letter-spacing: 0.31em;
    line-height: 1;
}

.note-detail__intro > span {
    width: 4px;
    height: 4px;
    background: var(--note-gold);
    transform: rotate(45deg);
}

.note-stage {
    display: flex;
    padding: clamp(98px, 17vh, 145px) 0 34px;
    flex-direction: column;
    align-items: center;
    transition: padding-top 520ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.note-paper {
    interpolate-size: allow-keywords;
    position: relative;
    display: block;
    width: min(68vw, 278px);
    height: clamp(142px, 18.5vh, 156px);
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 1px;
    background:
        radial-gradient(ellipse at 19% 14%, rgba(255, 255, 255, 0.24), transparent 39%),
        radial-gradient(ellipse at 78% 68%, rgba(185, 151, 138, 0.022), transparent 46%),
        radial-gradient(ellipse at 43% 91%, rgba(255, 255, 255, 0.13), transparent 36%),
        #fbf8f1;
    box-shadow:
        0 8px 15px -8px rgba(72, 61, 42, 0.34),
        0 3px 5px -3px rgba(72, 61, 42, 0.24),
        0 1px 1px rgba(72, 61, 42, 0.09),
        inset 0 -2px 1px -2px rgba(78, 66, 45, 0.24);
    color: var(--note-ink);
    cursor: pointer;
    transform: translateY(0) scale(1);
    transform-origin: center top;
    transition:
        width 520ms cubic-bezier(0.22, 0.72, 0.28, 1),
        height 520ms cubic-bezier(0.22, 0.72, 0.28, 1),
        box-shadow 520ms ease,
        transform 520ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.note-paper::before,
.note-paper::after {
    position: absolute;
    right: 1px;
    left: 1px;
    content: "";
    pointer-events: none;
    transition: opacity 360ms ease;
}

.note-paper::before {
    z-index: 5;
    bottom: 0;
    height: 2px;
    background:
        linear-gradient(90deg, transparent, rgba(112, 91, 68, 0.105) 8%, rgba(112, 91, 68, 0.125) 50%, rgba(112, 91, 68, 0.09) 92%, transparent) top / 100% 1px no-repeat,
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52) 10%, rgba(255, 255, 255, 0.62) 50%, rgba(255, 255, 255, 0.42) 90%, transparent) bottom / 100% 1px no-repeat;
    box-shadow: 0 1px 2px rgba(72, 61, 42, 0.12);
}

.note-paper::after {
    z-index: 1;
    top: 0;
    bottom: 2px;
    border: 1px solid rgba(111, 91, 67, 0.025);
    border-radius: inherit;
    box-shadow: inset 0 -1px 2px rgba(91, 73, 52, 0.035);
}

.note-paper:focus-visible {
    outline: 2px solid rgba(196, 160, 91, 0.62);
    outline-offset: 5px;
}

.note-paper:disabled {
    color: var(--note-ink);
    cursor: default;
    opacity: 1;
}

.note-paper__grain {
    position: absolute;
    z-index: 1;
    inset: 0;
    background-image: url("./assets/paper-grain.webp"), url("./assets/paper-grain.webp");
    background-position: 17px 29px, -83px -47px;
    background-size: 487px 487px, 331px 331px;
    background-blend-mode: soft-light;
    mix-blend-mode: multiply;
    opacity: 0.045;
    pointer-events: none;
}

.note-paper__fold {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: 0;
    left: 0;
    height: 2px;
    background:
        linear-gradient(90deg, transparent 1%, rgba(91, 77, 51, 0.075) 10%, rgba(91, 77, 51, 0.105) 50%, rgba(91, 77, 51, 0.07) 90%, transparent 99%) top / 100% 1px no-repeat,
        linear-gradient(90deg, transparent 1%, rgba(255, 255, 255, 0.5) 12%, rgba(255, 255, 255, 0.68) 50%, rgba(255, 255, 255, 0.44) 88%, transparent 99%) bottom / 100% 1px no-repeat;
    box-shadow:
        0 2px 3px -2px rgba(76, 61, 43, 0.22),
        inset 0 1px 1px rgba(91, 77, 51, 0.035);
    transition: opacity 360ms ease;
}

.note-paper__cover {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 1;
    transition: opacity 190ms ease, transform 300ms ease;
}

.note-paper__cover strong {
    font-family: Georgia, "Times New Roman", var(--display-font), serif;
    font-size: clamp(16px, 4.6vw, 19px);
    font-weight: 500;
    letter-spacing: 0.055em;
}

.note-hint {
    display: grid;
    margin: clamp(66px, 9vh, 82px) 0 0;
    padding-top: 0;
    justify-items: center;
    gap: 12px;
    color: rgba(57, 84, 81, 0.82);
    font-family: Georgia, "Times New Roman", var(--display-font), serif;
    font-size: 12px;
    letter-spacing: 0.18em;
    transition: opacity 180ms ease, transform 240ms ease;
}

.note-hint > span {
    position: relative;
    display: block;
    width: 70px;
    height: 1px;
    background: rgba(196, 160, 91, 0.54);
}

.note-hint i,
.note-content__rule i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: var(--note-gold);
    transform: translate(-50%, -50%) rotate(45deg);
}

.note-content {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    padding: clamp(42px, 7vh, 62px) clamp(29px, 8vw, 52px) 34px;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 260ms ease 220ms, transform 420ms cubic-bezier(0.22, 0.72, 0.28, 1) 120ms;
}

.note-content__title {
    text-align: center;
    font-family: Georgia, "Times New Roman", var(--display-font), serif;
    font-size: clamp(20px, 5.8vw, 25px);
    letter-spacing: 0.045em;
}

.note-content__rule {
    position: relative;
    width: 116px;
    height: 1px;
    margin: 12px auto clamp(29px, 5vh, 42px);
    background: rgba(196, 160, 91, 0.5);
}

.note-content__body {
    display: grid;
    gap: clamp(20px, 3.7vh, 30px);
    font-family: var(--display-font);
    font-size: clamp(13px, 3.55vw, 15px);
    letter-spacing: 0.035em;
    line-height: 1.9;
}

.note-content__body > span,
.note-content__signature,
.note-content__date { display: block; }

.note-content__signature {
    margin-top: auto;
    padding-top: clamp(38px, 5.5vh, 50px);
    font-family: var(--display-font);
    font-size: clamp(13px, 3.55vw, 15px);
    letter-spacing: 0.045em;
    line-height: 1.9;
}

.note-content__date {
    align-self: flex-end;
    margin-top: 13px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(196, 160, 91, 0.48);
    font-family: Georgia, "Times New Roman", var(--display-font), serif;
    font-size: 13px;
    letter-spacing: 0.055em;
}

.note-detail.is-opening .note-stage,
.note-detail.is-opened .note-stage {
    padding-top: clamp(22px, 4vh, 38px);
}

.note-detail.is-opening .note-paper,
.note-detail.is-opened .note-paper {
    width: min(78vw, 360px);
    height: auto;
    box-shadow:
        0 7px 16px -10px rgba(72, 61, 42, 0.28),
        0 3px 7px -5px rgba(72, 61, 42, 0.2),
        0 1px 2px rgba(72, 61, 42, 0.055);
}

.note-detail.is-opening .note-paper::before,
.note-detail.is-opened .note-paper::before {
    opacity: 0;
}

.note-detail.is-opening .note-paper::after,
.note-detail.is-opened .note-paper::after {
    bottom: 0;
    opacity: 0.72;
}

.note-detail.is-opening .note-paper__cover,
.note-detail.is-opened .note-paper__cover {
    opacity: 0;
    transform: translateY(-8px);
}

.note-detail.is-opening .note-paper__fold,
.note-detail.is-opened .note-paper__fold {
    top: 50%;
    z-index: 2;
    opacity: 0.28;
}

.note-detail.is-opening .note-content,
.note-detail.is-opened .note-content {
    position: relative;
    z-index: 3;
    opacity: 1;
    transform: translateY(0);
}

.note-detail.is-opening .note-hint,
.note-detail.is-opened .note-hint {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

/* Once the reveal settles, Gift 05 becomes a content-driven reading flow. */
.gift-detail-scene[data-active-gift="note"]:has(.note-detail.is-opened) .gift-detail {
    min-height: 0;
    padding-bottom: 0;
}

.note-detail.is-opened {
    min-height: 0;
}

.note-detail.is-opened .note-stage {
    padding-bottom: max(52px, env(safe-area-inset-bottom));
}

.note-detail.is-opened .note-hint {
    display: none;
}

/* Gift 04: a private archive that stays flat, ordered, and quietly editorial. */
.memory-view {
    --memory-ink: #3f5751;
    --memory-muted: #74847f;
    --memory-gold: #c5a35e;
    --memory-line: rgba(76, 96, 91, 0.22);
    width: 100%;
    color: var(--memory-ink);
    opacity: 1;
    transform: scale(1);
    transform-origin: center top;
    transition: opacity 200ms ease, transform 200ms ease;
}

.memory-view.is-leaving { opacity: 0; transform: scale(0.995); }
.memory-view.is-entering { opacity: 0; transform: scale(1.005); }
.memory-archive, .memory-viewer { width: 100%; }

.memory-archive { padding: 4px 4px 16px; }

.memory-archive__intro,
.memory-archive__order,
.memory-archive__footer {
    margin: 18px 2px 22px;
    color: rgba(62, 79, 76, 0.78);
    font-size: 13px;
    line-height: 1.72;
}

.memory-archive__intro p,
.memory-archive__order p,
.memory-archive__footer p { margin: 0 0 10px; }

.memory-archive__order h3,
.memory-archive__footer h3 {
    margin: 20px 0 10px;
    color: var(--memory-ink);
    font-family: var(--utility-font);
    font-size: 11px;
    letter-spacing: 0.08em;
}

.memory-archive__order ul {
    margin: 0;
    padding-left: 19px;
}

.memory-archive__footer {
    padding-top: 15px;
    border-top: 1px solid var(--memory-line);
}

.memory-archive__title { text-align: center; }
.memory-archive__title h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", var(--display-font), serif;
    font-size: clamp(23px, 6.7vw, 29px);
    font-weight: 500;
    letter-spacing: 0.19em;
    line-height: 1.1;
}
.memory-archive__title p {
    margin: 6px 0 0;
    color: var(--memory-muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
    font-style: italic;
    letter-spacing: 0.09em;
}

.memory-status {
    display: grid;
    width: min(88%, 360px);
    min-height: clamp(122px, calc(5vw + 103.5px), 125px);
    margin: 14px auto 24px;
    padding: 20px 18px 18px;
    border: 1px solid rgba(85, 101, 96, 0.21);
    border-radius: 16px;
    background: rgba(255, 251, 241, 0.56);
    box-shadow: 0 6px 14px rgba(70, 75, 55, 0.055);
    justify-items: center;
}
.memory-status p, .memory-status strong, .memory-status span { margin: 0; }
.memory-status p {
    font-family: var(--utility-font);
    font-size: 10px;
    letter-spacing: 0.12em;
}
.memory-status strong {
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(17px, 4.77vw, 20.7px);
    font-weight: 400;
    letter-spacing: 0.025em;
    line-height: 1.15;
}
.memory-status > span {
    margin-top: 9px;
    color: var(--memory-muted);
    font-family: var(--utility-font);
    font-size: 10px;
    letter-spacing: 0.07em;
}
.memory-status__dots { display: flex; margin-top: 13px; gap: 13px; }
.memory-status__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--memory-gold); opacity: 0.78; }

.memory-directory h3 {
    margin: 0;
    padding: 0 0 13px;
    border-bottom: 1px solid var(--memory-line);
    font-family: var(--utility-font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
}
.memory-file { display: grid; width: 100%; min-height: 94px; margin: 0; padding: 13px 2px; border: 0; border-bottom: 1px solid var(--memory-line); background: transparent; color: var(--memory-ink); cursor: pointer; grid-template-columns: 50px minmax(0, 1fr) 24px; align-items: center; gap: 7px; text-align: left; transition: opacity 120ms ease; }
.memory-file:active { opacity: 0.72; }
.memory-file__number { align-self: start; padding-top: 5px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: 0.12em; }
.memory-file__copy { display: grid; min-width: 0; gap: 5px; }
.memory-file__id { display: flex; align-items: center; gap: 7px; font-family: var(--utility-font); font-size: 11px; letter-spacing: 0.08em; }
.memory-file__id i { width: 6px; height: 6px; border: 1px solid rgba(63, 89, 83, 0.48); border-radius: 50%; background: transparent; flex: 0 0 auto; }
.memory-file.is-viewed .memory-file__id i { border-color: var(--memory-gold); background: var(--memory-gold); }
.memory-file__copy strong { overflow: hidden; font-family: var(--display-font); font-size: clamp(13px, 3.7vw, 15px); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.memory-file__copy small { overflow: hidden; color: var(--memory-muted); font-family: var(--utility-font); font-size: 9.5px; letter-spacing: 0.055em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.memory-file__arrow { justify-self: end; font-family: Georgia, serif; font-size: 26px; font-weight: 300; transition: transform 120ms ease; }
.memory-file:active .memory-file__arrow { transform: translateX(3px); }

.memory-viewer { padding: 0 4px 8px; }
.memory-viewer__nav { display: flex; min-height: 38px; align-items: center; justify-content: space-between; font-family: var(--utility-font); font-size: 10.5px; letter-spacing: 0.09em; }
.memory-viewer__nav button { min-height: 38px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; letter-spacing: inherit; }
.memory-breadcrumb { overflow-wrap: anywhere; margin: 1px 0 0; padding: 0 0 14px; border-bottom: 1px solid var(--memory-line); color: var(--memory-muted); font-family: var(--utility-font); font-size: 10px; letter-spacing: 0.06em; }
.memory-record__header { padding: 28px 0 22px; border-bottom: 1px solid var(--memory-line); }
.memory-record__header p { margin: 0 0 13px; font-family: var(--utility-font); font-size: 10px; letter-spacing: 0.085em; }
.memory-record__header h3 { margin: 0; font-family: Georgia, "Times New Roman", var(--display-font), serif; font-size: clamp(25px, 7.5vw, 31px); font-weight: 500; letter-spacing: 0.01em; line-height: 1.2; }
.memory-record__body { padding: 24px 0 17px; }
.memory-record__body > p { margin: 0 0 19px; color: rgba(62, 79, 76, 0.84); font-size: clamp(15px, 4vw, 16px); line-height: 1.78; overflow-wrap: anywhere; }
.memory-record__body h4,
.memory-record__body h5 { margin: 22px 0 11px; color: var(--memory-ink); font-family: var(--display-font); font-weight: 600; line-height: 1.35; }
.memory-record__body h4 { font-size: 18px; }
.memory-record__body h5 { font-size: 15px; }
.memory-record__body strong { color: var(--memory-ink); }
.memory-note { position: relative; display: grid; margin: 22px 0; padding: 19px 18px 17px; border: 1px solid rgba(190, 151, 78, 0.58); border-radius: 14px; background: rgba(255, 252, 244, 0.3); }
.memory-note i { position: absolute; top: -11px; left: 10px; padding: 0 4px; background: var(--detail-paper); color: var(--memory-gold); font-size: 18px; font-style: normal; }
.memory-note p { margin: 0; color: rgba(62, 79, 76, 0.84); font-size: 14px; line-height: 1.72; }
.memory-image { margin: 2px 0 23px; }
.memory-image__asset { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid rgba(76, 96, 91, 0.14); border-radius: 10px; box-shadow: 0 5px 12px rgba(70, 75, 55, 0.055); }
.memory-image__fallback[hidden] { display: none; }
.memory-image > div { display: grid; width: 100%; aspect-ratio: 16 / 10; border: 1px solid rgba(76, 96, 91, 0.14); border-radius: 10px; background: linear-gradient(145deg, rgba(221, 226, 207, 0.64), rgba(249, 240, 218, 0.7)); box-shadow: 0 5px 12px rgba(70, 75, 55, 0.055); place-content: center; justify-items: center; gap: 4px; color: var(--memory-muted); }
.memory-image > div span { font-family: Georgia, serif; font-size: 18px; letter-spacing: 0.14em; }
.memory-image > div small, .memory-image figcaption { font-family: var(--utility-font); font-size: 9px; letter-spacing: 0.09em; }
.memory-image figcaption { margin-top: 9px; color: var(--memory-muted); }
.memory-record__saved { display: grid; padding: 19px 0 18px; border-top: 1px solid var(--memory-line); gap: 6px; font-family: var(--utility-font); font-size: 10px; letter-spacing: 0.09em; }
.memory-record__saved strong { color: var(--memory-muted); font-size: 11px; font-weight: 400; }
.memory-record__pager { display: grid; min-height: 76px; padding-top: 12px; border-top: 1px solid var(--memory-line); grid-template-columns: 1fr 1fr; align-items: start; }
.memory-record__pager button { display: grid; min-height: 54px; margin: 0; padding: 4px 0; border: 0; background: transparent; color: inherit; cursor: pointer; justify-items: start; gap: 6px; font-family: var(--utility-font); font-size: 11px; letter-spacing: 0.09em; text-align: left; }
.memory-record__pager button:last-child { border-left: 1px solid var(--memory-line); justify-items: end; text-align: right; }
.memory-record__pager > span:first-child + button:last-child { border-left: 0; }
.memory-record__pager small { color: var(--memory-muted); font-size: 9.5px; letter-spacing: 0.07em; }

/* Gift 03: a deliberately quiet egg whose reward is reserved for the second tap. */
.egg-experience {
    --egg-width: clamp(252px, 66.7vw, 286px);
    display: grid;
    min-height: calc(100dvh - 127px - env(safe-area-inset-bottom));
    padding: clamp(22px, 5.8vh, 52px) 0 34px;
    grid-template-rows: auto calc(var(--egg-width) * 1.375) auto;
    row-gap: clamp(44px, 5.4vh, 48px);
    align-items: center;
    align-content: start;
    justify-items: center;
}

.egg-detail__label {
    margin: 0;
    color: rgba(57, 84, 81, 0.58);
    font-family: var(--utility-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    line-height: 1;
}

.egg-stage {
    position: relative;
    display: grid;
    width: 100%;
    height: calc(var(--egg-width) * 1.375);
    place-items: center;
    isolation: isolate;
}

.egg-shell-interaction {
    position: relative;
    z-index: 3;
    display: block;
    width: var(--egg-width);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transform: scale(1);
    transform-origin: 50% 76%;
}

.egg-shell-interaction:focus-visible {
    border-radius: 48% 48% 44% 44% / 58% 58% 42% 42%;
    outline: 2px solid rgba(94, 143, 136, 0.68);
    outline-offset: 7px;
}

.egg-shell-interaction:disabled {
    cursor: default;
}

.egg-experience.is-pressed .egg-shell-interaction {
    animation: egg-press 170ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

.egg-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.egg-ground-shadow {
    fill: rgba(101, 79, 40, 0.1);
    filter: blur(3px);
}

.egg-surface {
    filter: url(#eggMatteSurface);
}

.egg-highlight {
    fill: none;
    stroke: rgba(255, 255, 248, 0.2);
    stroke-linecap: round;
    stroke-width: 8;
    filter: blur(2.8px);
}

.crack-line {
    fill: none;
    stroke: rgba(111, 91, 55, 0.58);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    opacity: 0;
    transition: stroke-dashoffset 260ms cubic-bezier(0.22, 0.72, 0.28, 1), opacity 100ms ease;
}

.egg-shell-pieces {
    opacity: 0;
    pointer-events: none;
}

.shell-left,
.shell-right,
.shell-bottom {
    transform-box: fill-box;
    transition: transform 380ms cubic-bezier(0.2, 0.7, 0.25, 1);
}

.shell-left {
    transform-origin: 70% 76%;
}

.shell-right {
    transform-origin: 30% 76%;
}

.shell-bottom {
    transform-origin: center center;
}

.egg-experience[data-stage="cracked"] .crack-line {
    stroke-dashoffset: 0;
    opacity: 1;
}

.egg-experience:is([data-stage="revealing"], [data-stage="revealed"]) .egg-base {
    opacity: 0;
}

.egg-experience:is([data-stage="revealing"], [data-stage="revealed"]) .egg-shell-pieces {
    opacity: 1;
}

.egg-experience:is([data-stage="revealing"], [data-stage="revealed"]) .shell-left {
    transform: translate(-32px, -20px) rotate(-8deg);
}

.egg-experience:is([data-stage="revealing"], [data-stage="revealed"]) .shell-right {
    transform: translate(32px, -20px) rotate(8deg);
}

.egg-experience:is([data-stage="revealing"], [data-stage="revealed"]) .shell-bottom {
    transform: translateY(30px);
}

.egg-experience:is([data-stage="revealing"], [data-stage="revealed"]) .egg-detail__label,
.egg-experience:is([data-stage="revealing"], [data-stage="revealed"]) .egg-hint {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.egg-reveal-card {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 50%;
    display: grid;
    width: min(76vw, 326px);
    min-height: clamp(228px, 28vh, 250px);
    padding: 24px 21px 19px;
    border: 1px solid rgba(147, 126, 80, 0.14);
    border-radius: 14px;
    background: rgba(255, 252, 243, 0.98);
    box-shadow: 0 11px 25px rgba(77, 66, 42, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.96);
    transition: opacity 380ms ease 80ms, transform 380ms cubic-bezier(0.22, 0.72, 0.28, 1) 80ms;
    align-content: space-between;
    text-align: center;
}

.egg-reveal-card > p,
.egg-reveal-card footer {
    margin: 0;
    color: rgba(57, 84, 81, 0.64);
    font-family: var(--utility-font);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.13em;
}

.egg-reveal-card__content {
    display: grid;
    max-height: 100%;
    gap: 8px;
    justify-items: stretch;
    overflow-y: auto;
    text-align: left;
}

.egg-reveal-card__content h3,
.egg-reveal-card__content h4,
.egg-reveal-card__content h5,
.egg-reveal-card__content p {
    margin: 0;
    color: rgba(57, 84, 81, 0.78);
    font-family: var(--display-font);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.62;
}

.egg-reveal-card__content h3 {
    color: rgba(57, 84, 81, 0.86);
    font-size: 16px;
    text-align: center;
}

.egg-reveal-card__content h4 {
    margin-top: 3px;
    color: rgba(57, 84, 81, 0.82);
    font-size: 13px;
}

.egg-reveal-card__content strong {
    color: rgba(57, 84, 81, 0.9);
}

.egg-reveal-card__content p + p {
    margin-top: 2px;
}

.egg-reveal-card__content p {
    letter-spacing: 0.015em;
    word-break: keep-all;
}

.egg-experience:is([data-stage="revealing"], [data-stage="revealed"]) .egg-reveal-card {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.egg-particles {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.egg-particles i {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(196, 160, 91, 0.82);
    box-shadow: 0 0 5px rgba(196, 160, 91, 0.22);
    opacity: 0;
}

.egg-experience[data-stage="revealing"] .egg-particles i {
    animation: egg-particle 480ms ease-out var(--particle-delay) both;
}

.egg-hint {
    min-height: 1.2em;
    margin: 0;
    color: rgba(57, 84, 81, 0.56);
    font-family: var(--utility-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1.2;
    text-align: center;
}

@keyframes egg-press {
    0%, 100% { transform: scale(1); }
    52% { transform: scale(0.98); }
}

@keyframes egg-particle {
    0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
    28% { opacity: 0.9; }
    100% { opacity: 0; transform: translate(var(--particle-x), var(--particle-y)) scale(0.15); }
}

@media (max-height: 760px) {
    .egg-experience {
        min-height: 610px;
        padding-top: 16px;
        grid-template-rows: auto calc(var(--egg-width) * 1.375) auto;
        row-gap: 40px;
    }

    .egg-stage {
        height: calc(var(--egg-width) * 1.375);
    }
}

/* Gift 02: quiet printed-guide states inside the shared detail scene. */
.guide-view {
    --guide-ink: #405b54;
    --guide-muted: #72837f;
    --guide-gold: #ba9654;
    --guide-line: rgba(89, 109, 104, 0.2);
    width: 100%;
    opacity: 1;
    transform: scale(1);
    transform-origin: center top;
    transition: opacity 190ms ease, transform 190ms ease;
}

.guide-view.is-leaving {
    opacity: 0;
    transform: scale(0.995);
}

.guide-view.is-entering {
    opacity: 0;
    transform: scale(1.005);
}

.guide-index,
.guide-reader {
    width: 100%;
}

.guide-cover,
.guide-page {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(165, 133, 76, 0.28);
    border-radius: clamp(12px, 3.6vw, 16px);
    background: #fbf6e9;
    box-shadow: 0 10px 20px rgba(80, 68, 44, 0.11), 0 2px 5px rgba(80, 68, 44, 0.07);
}

.guide-cover {
    --guide-cover-scale: 0.85;
    width: min(85%, 326px);
    max-width: 326px;
    min-height: 0;
    aspect-ratio: 1 / 1.272;
    margin: 0 auto;
    padding: 9px;
    color: var(--guide-ink);
}

.guide-paper-grain,
.guide-cover::after,
.guide-page::after {
    position: absolute;
    z-index: 0;
    inset: 0;
    background: url("./assets/paper-grain.webp") repeat;
    background-size: 256px 256px;
    content: "";
    mix-blend-mode: multiply;
    opacity: 0.028;
    pointer-events: none;
}

.guide-cover__frame {
    position: relative;
    z-index: 1;
    display: grid;
    width: calc(100% / var(--guide-cover-scale));
    height: calc(100% / var(--guide-cover-scale));
    min-height: 0;
    padding: clamp(19px, 5vw, 24px) clamp(17px, 4.8vw, 23px) 17px;
    border: 1px solid rgba(186, 150, 84, 0.72);
    border-radius: clamp(8px, 2.6vw, 11px);
    align-content: start;
    text-align: center;
    transform: scale(var(--guide-cover-scale));
    transform-origin: top left;
}

.guide-cover__frame::before {
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(186, 150, 84, 0.21);
    border-radius: 7px;
    content: "";
    pointer-events: none;
}

.guide-cover p,
.guide-cover h3 {
    margin: 0;
}

.guide-cover__eyebrow,
.guide-cover__edition,
.guide-cover__only,
.guide-cover__meta {
    font-family: var(--display-font);
    letter-spacing: 0.14em;
}

.guide-cover__eyebrow {
    font-size: clamp(10px, 2.9vw, 12px);
    line-height: 1;
}

.guide-cover__title {
    margin-top: 9px !important;
    font-family: Georgia, "Times New Roman", var(--display-font), serif;
    font-size: clamp(35px, 10.2vw, 46px);
    font-weight: 500;
    letter-spacing: 0.035em;
    line-height: 0.98;
}

.guide-cover__subtitle {
    display: flex;
    margin-top: 10px !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--display-font);
    font-size: clamp(13px, 3.7vw, 16px);
    letter-spacing: 0.09em;
}

.guide-cover__subtitle i {
    width: 24px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--guide-gold));
}

.guide-cover__subtitle i:last-child {
    background: linear-gradient(to left, transparent, var(--guide-gold));
}

.guide-cover__art {
    height: clamp(145px, 39vw, 177px);
    margin-top: 2px;
}

.guide-cover__art svg {
    width: 100%;
    height: 100%;
    fill: rgba(186, 150, 84, 0.055);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.guide-art__sage {
    stroke: rgba(64, 91, 84, 0.72);
    stroke-width: 1.65;
}

.guide-art__gold,
.guide-art__side {
    stroke: rgba(186, 150, 84, 0.72);
    stroke-width: 1.35;
}

.guide-art__side {
    fill: rgba(115, 139, 105, 0.075);
    stroke: rgba(64, 91, 84, 0.64);
}

.guide-cover__edition {
    font-size: clamp(14px, 4vw, 17px);
    line-height: 1;
}

.guide-cover__only {
    margin-top: 10px !important;
    color: rgba(64, 91, 84, 0.82);
    font-size: 10px;
    letter-spacing: 0.18em;
}

.guide-cover__only::before,
.guide-cover__only::after {
    display: inline-block;
    width: 34px;
    height: 1px;
    margin: 0 10px 3px;
    background: rgba(186, 150, 84, 0.5);
    content: "";
}

.guide-cover__meta {
    display: flex;
    margin-top: 16px !important;
    justify-content: space-between;
    font-size: 9px;
    letter-spacing: 0.1em;
}

.guide-contents {
    padding: 19px 8px 4px;
    color: var(--guide-ink);
}

.guide-contents__header {
    text-align: center;
}

.guide-contents__header h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", var(--display-font), serif;
    font-size: clamp(24px, 7vw, 29px);
    font-weight: 500;
    letter-spacing: 0.09em;
    line-height: 1.1;
}

.guide-contents__header h3 span {
    color: var(--guide-gold);
    font-size: 10px;
    vertical-align: middle;
}

.guide-contents__header p {
    margin: 7px 0 9px;
    color: var(--guide-muted);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.guide-chapter-list {
    border-top: 1px solid var(--guide-line);
}

.guide-chapter-item {
    display: grid;
    width: 100%;
    min-height: 68px;
    margin: 0;
    padding: 10px 3px;
    border: 0;
    border-bottom: 1px solid var(--guide-line);
    background: transparent;
    color: var(--guide-ink);
    cursor: pointer;
    grid-template-columns: 46px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 6px;
    text-align: left;
    transition: opacity 130ms ease;
}

.guide-chapter-item:active {
    opacity: 0.64;
}

.guide-chapter-item__number {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
    font-variant-numeric: tabular-nums;
}

.guide-chapter-item__copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.guide-chapter-item__copy strong {
    overflow: hidden;
    font-family: var(--display-font);
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 600;
    letter-spacing: 0.025em;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guide-chapter-item__copy small {
    overflow: hidden;
    color: var(--guide-muted);
    font-size: 10.5px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guide-chapter-item__arrow {
    font-family: Georgia, serif;
    font-size: 25px;
    transition: transform 130ms ease;
}

.guide-chapter-item:active .guide-chapter-item__arrow {
    transform: translateX(2px);
}

.guide-reader__nav {
    display: flex;
    min-height: 41px;
    padding: 0 10px;
    border-bottom: 1px solid rgba(89, 109, 104, 0.18);
    align-items: center;
    justify-content: space-between;
    color: var(--guide-ink);
    font-family: var(--utility-font);
    font-size: 11px;
    letter-spacing: 0.08em;
}

.guide-reader__nav button,
.guide-page__footer button {
    margin: 0;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    letter-spacing: inherit;
}

.guide-page {
    margin-top: 8px;
    padding: clamp(25px, 7vw, 32px) clamp(20px, 6.3vw, 29px) 19px;
    color: rgba(62, 77, 62, 0.83);
    box-shadow: 0 5px 13px rgba(80, 68, 44, 0.07);
}

.guide-page > * {
    position: relative;
    z-index: 1;
}

.guide-page__header {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(186, 150, 84, 0.48);
    text-align: left;
}

.guide-page__header p {
    margin: 0 0 9px;
    color: var(--guide-gold);
    font-family: var(--utility-font);
    font-size: 10px;
    letter-spacing: 0.14em;
}

.guide-page__header h3 {
    margin: 0;
    color: var(--guide-ink);
    font-family: var(--display-font);
    font-size: clamp(24px, 7vw, 28px);
    font-weight: 600;
    letter-spacing: 0.035em;
    line-height: 1.22;
}

.guide-page__header span {
    display: block;
    margin-top: 8px;
    color: var(--guide-muted);
    font-size: 11.5px;
    line-height: 1.55;
}

.guide-page__body {
    padding: 19px 0 6px;
}

.guide-page__body > p {
    margin: 0 0 16px;
    font-size: clamp(15px, 3.9vw, 16px);
    line-height: 1.76;
    text-align: justify;
}

.guide-page__body h4,
.guide-page__body h5,
.guide-page__body p,
.guide-page__body ul,
.guide-page__body aside {
    overflow-wrap: anywhere;
}

.guide-page__body h4,
.guide-page__body h5 {
    margin: 22px 0 11px;
    color: var(--guide-ink);
    font-family: var(--display-font);
    font-weight: 600;
    line-height: 1.35;
}

.guide-page__body h4 { font-size: 17px; }
.guide-page__body h5 { font-size: 15px; }

.guide-page__body ul {
    margin: 0 0 17px;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.7;
}

.guide-page__body li + li { margin-top: 5px; }

.guide-page__body code,
.memory-record__body code {
    padding: 1px 4px;
    border: 1px solid rgba(89, 109, 104, 0.18);
    border-radius: 4px;
    background: rgba(233, 237, 220, 0.56);
    color: var(--guide-ink);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

.guide-callout {
    display: grid;
    margin: 20px 0;
    padding: 14px 14px 14px 12px;
    border: 1px solid rgba(88, 108, 80, 0.3);
    border-radius: 13px;
    background: rgba(233, 237, 220, 0.62);
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 10px;
}

.guide-callout__icon {
    color: var(--guide-gold);
    font-size: 14px;
}

.guide-callout strong {
    color: var(--guide-ink);
    font-family: var(--utility-font);
    font-size: 12px;
    letter-spacing: 0.1em;
}

.guide-callout p {
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.62;
}

.guide-figure {
    margin: 21px 0;
    padding: 17px 12px 11px;
    border: 1px solid rgba(186, 150, 84, 0.4);
    border-radius: 13px;
    background: rgba(255, 251, 239, 0.58);
}

.guide-figure > div {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-around;
    color: var(--guide-ink);
}

.guide-figure > div span {
    display: grid;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(64, 91, 84, 0.55);
    border-radius: 50%;
    place-items: center;
    font-size: 20px;
}

.guide-figure > div .guide-figure__screen {
    width: 70px;
    border-radius: 4px;
}

.guide-figure i {
    font-style: normal;
}

.guide-figure figcaption {
    margin-top: 9px;
    color: var(--guide-muted);
    font-family: var(--utility-font);
    font-size: 9.5px;
    letter-spacing: 0.07em;
    text-align: center;
}

.guide-page__footer {
    display: grid;
    min-height: 62px;
    padding-top: 10px;
    border-top: 1px solid rgba(89, 109, 104, 0.18);
    grid-template-columns: 1fr 1fr;
    align-items: center;
    color: var(--guide-ink);
    font-family: var(--utility-font);
    letter-spacing: 0.07em;
}

.guide-page__footer button {
    display: grid;
    gap: 5px;
    justify-items: start;
    text-align: left;
}

.guide-page__footer button:last-child {
    justify-self: end;
    justify-items: end;
    text-align: right;
}

.guide-page__footer small {
    color: var(--guide-muted);
    font-size: 8px;
    letter-spacing: 0.08em;
}

.birthday-pass-reveal {
    width: 100%;
    opacity: 0;
    transform: scale(0.97);
    transform-origin: center center;
    transition: opacity 250ms ease 35ms, transform 250ms cubic-bezier(0.22, 0.72, 0.28, 1) 35ms;
}

.gift-detail-scene.is-visible .birthday-pass-reveal {
    opacity: 1;
    transform: scale(1);
}

.birthday-pass {
    --pass-gold: #a88e5b;
    --pass-gold-soft: rgba(168, 142, 91, 0.46);
    --pass-edge-light: rgba(255, 255, 255, 0.34);
    --pass-edge-dark: rgba(50, 72, 52, 0.105);
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1.58 / 1;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: clamp(27px, 7.5vw, 31px);
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.105), transparent 39%, rgba(50, 72, 52, 0.024) 100%),
        var(--detail-pass);
    box-shadow:
        0 1px 0 var(--pass-edge-light),
        0 15px 26px rgba(50, 72, 52, 0.145),
        0 4px 8px rgba(50, 72, 52, 0.085),
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 -2px 2px var(--pass-edge-dark);
    color: var(--sage-deep);
    cursor: pointer;
    text-align: left;
    transition: box-shadow 120ms ease, transform 120ms ease;
}

.birthday-pass::before {
    position: absolute;
    z-index: 2;
    inset: 9px;
    border: 1px solid rgba(247, 241, 218, 0.39);
    border-radius: calc(clamp(27px, 7.5vw, 31px) - 8px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 0 0 1px rgba(50, 72, 52, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.08);
    content: "";
    pointer-events: none;
}

.birthday-pass::after {
    position: absolute;
    z-index: 5;
    inset: 0;
    border-radius: inherit;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 1px 0 0 rgba(255, 255, 255, 0.12),
        inset -1px 0 0 rgba(50, 72, 52, 0.04),
        inset 0 -2px 2px rgba(50, 72, 52, 0.085);
    content: "";
    pointer-events: none;
}

.birthday-pass:active {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.24),
        0 8px 15px rgba(50, 72, 52, 0.125),
        0 2px 5px rgba(50, 72, 52, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 2px rgba(50, 72, 52, 0.1);
    transform: scale(0.985);
}

.birthday-pass__grain {
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background-image: url("./assets/paper-grain.webp");
    background-repeat: repeat;
    background-size: 256px 256px;
    mix-blend-mode: soft-light;
    opacity: 0.045;
    pointer-events: none;
    user-select: none;
}

.birthday-pass__botanical {
    position: absolute;
    z-index: 1;
    right: -5px;
    bottom: -24px;
    width: 102px;
    height: 132px;
    color: rgba(48, 75, 53, 0.075);
    mix-blend-mode: multiply;
    opacity: 0.6;
    pointer-events: none;
}

.birthday-pass__botanical svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.45;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.18));
}

.birthday-pass__meta {
    position: absolute;
    z-index: 3;
    color: rgba(48, 76, 57, 0.9);
    font-family: var(--utility-font);
    font-size: clamp(9px, 2.65vw, 11px);
    font-weight: 650;
    letter-spacing: 0.055em;
    line-height: 1.25;
}

.birthday-pass__meta--top-left {
    top: 24px;
    left: 24px;
}

.birthday-pass__meta--top-left span {
    margin-left: 4px;
    color: var(--pass-gold);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.birthday-pass__meta--top-right {
    top: 23px;
    right: 24px;
    display: grid;
    gap: 1px;
    justify-items: start;
}

.birthday-pass__meta--top-right strong {
    font-size: 1.02em;
    letter-spacing: 0.07em;
}

.birthday-pass__meta--bottom-left {
    bottom: 21px;
    left: 24px;
}

.birthday-pass__meta--bottom-right {
    right: 24px;
    bottom: 21px;
}

.birthday-pass__center {
    position: absolute;
    z-index: 3;
    top: 47px;
    right: 18px;
    bottom: 39px;
    left: 18px;
    display: grid;
    grid-template-rows: minmax(66px, 1fr) auto auto;
    align-items: center;
    justify-items: center;
}

.birthday-pass__emblem {
    position: relative;
    display: grid;
    width: clamp(72px, 21vw, 88px);
    height: clamp(72px, 21vw, 88px);
    border: 1px solid var(--pass-gold-soft);
    border-radius: 50%;
    background:
        radial-gradient(circle at 44% 40%, rgba(246, 239, 211, 0.4), rgba(236, 228, 196, 0.28) 62%, rgba(70, 91, 66, 0.055) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2),
        0 2px 3px rgba(50, 72, 52, 0.04),
        inset 0 1px 1px rgba(255, 255, 255, 0.34),
        inset 0 -2px 3px rgba(50, 72, 52, 0.09),
        inset 0 0 0 5px rgba(247, 241, 216, 0.1);
    color: var(--pass-gold);
    place-items: center;
}

.birthday-pass__emblem::before {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(168, 142, 91, 0.2);
    border-radius: 50%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 1px 0 rgba(50, 72, 52, 0.045);
    content: "";
    pointer-events: none;
}

.birthday-pass__emblem svg {
    position: relative;
    z-index: 1;
    width: 94%;
    height: 94%;
    fill: rgba(168, 142, 91, 0.085);
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    filter:
        drop-shadow(0 1px 0 rgba(255, 255, 255, 0.34))
        drop-shadow(0 -0.5px 0 rgba(55, 73, 52, 0.08));
}

.birthday-pass__emblem .birthday-pass__laurel {
    fill: none;
    stroke: rgba(93, 119, 88, 0.6);
    stroke-width: 1.8;
}

.birthday-pass__emblem .birthday-pass__crown,
.birthday-pass__emblem .birthday-pass__spark {
    fill: rgba(168, 142, 91, 0.1);
    stroke: var(--pass-gold);
    stroke-width: 2.15;
}

.birthday-pass__name {
    color: #3d5a44;
    font-family: var(--display-font);
    font-size: clamp(22px, 6.4vw, 28px);
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
}

.birthday-pass__status {
    display: flex;
    margin-top: 6px;
    align-items: center;
    gap: 8px;
    color: var(--pass-gold);
    font-family: var(--utility-font);
    font-size: clamp(9px, 2.7vw, 11.5px);
    font-weight: 600;
    letter-spacing: 0.075em;
    line-height: 1;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.24),
        0 -1px 0 rgba(55, 73, 52, 0.045);
    white-space: nowrap;
}

.birthday-pass__status i {
    width: clamp(24px, 8vw, 40px);
    height: 1px;
    background: linear-gradient(to right, transparent, var(--pass-gold-soft));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

.birthday-pass__status i:last-child {
    background: linear-gradient(to left, transparent, var(--pass-gold-soft));
}

.rights-status {
    display: grid;
    width: 100%;
    min-height: 76px;
    margin: 15px 0 17px;
    padding: 11px 17px;
    border: 1px solid rgba(57, 84, 81, 0.07);
    border-radius: 22px;
    background: rgba(255, 252, 242, 0.82);
    box-shadow: 0 6px 14px rgba(57, 84, 81, 0.08);
    grid-template-columns: 48px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 12px;
}

.rights-status__check {
    display: grid;
    width: 46px;
    height: 46px;
    border: 2px solid rgba(255, 253, 247, 0.82);
    border-radius: 50%;
    background: linear-gradient(145deg, #aac19d, #6f956f);
    box-shadow: 0 3px 8px rgba(57, 84, 81, 0.15), inset 0 0 0 1px rgba(57, 84, 81, 0.14);
    color: #fffdf7;
    place-items: center;
}

.rights-status__check svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.rights-status__copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.rights-status__copy strong {
    overflow: hidden;
    color: var(--sage-deep);
    font-size: clamp(13.5px, 3.75vw, 16px);
    font-weight: 650;
    letter-spacing: 0.02em;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rights-status__copy span {
    color: rgba(57, 84, 81, 0.62);
    font-size: clamp(10.5px, 2.85vw, 12px);
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.rights-status__gift {
    color: #b3955c;
}

.rights-status__gift svg {
    width: 38px;
    height: 38px;
    fill: rgba(215, 183, 122, 0.1);
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.4;
}

.rights-list {
    display: grid;
    gap: 12px;
}

.right-item {
    border: 1px solid rgba(57, 84, 81, 0.045);
    border-radius: 21px;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(57, 84, 81, 0.075), 0 1px 3px rgba(57, 84, 81, 0.045);
    transition: box-shadow 210ms ease;
}

.right-item--cream {
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.26), transparent 64%), var(--detail-cream);
}

.right-item--sage {
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.22), transparent 64%), var(--detail-sage-pale);
}

.right-item.is-expanded {
    box-shadow: 0 8px 18px rgba(57, 84, 81, 0.1), 0 1px 3px rgba(57, 84, 81, 0.05);
}

.right-item__trigger {
    display: grid;
    width: 100%;
    min-height: 98px;
    margin: 0;
    padding: 13px 15px;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    grid-template-columns: 58px 32px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.right-item__icon {
    display: grid;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(57, 84, 81, 0.055);
    border-radius: 50%;
    background: rgba(255, 253, 247, 0.88);
    box-shadow: 0 4px 10px rgba(57, 84, 81, 0.08);
    color: #7b916f;
    place-items: center;
}

.right-item__icon svg {
    width: 42px;
    height: 42px;
    fill: rgba(215, 183, 122, 0.08);
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.right-item__number {
    align-self: start;
    padding-top: 15px;
    color: rgba(57, 84, 81, 0.58);
    font-family: var(--utility-font);
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
}

.right-item__copy {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.right-item__copy strong {
    overflow-wrap: anywhere;
    color: #315440;
    font-size: clamp(15px, 4.15vw, 18px);
    font-weight: 650;
    letter-spacing: 0.015em;
    line-height: 1.25;
    white-space: normal;
}

.right-item__copy strong em {
    color: #b3955c;
    font-size: 0.84em;
    font-style: normal;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.right-item[data-right-id="right04"] .right-item__copy strong {
    font-size: clamp(14px, 3.9vw, 17px);
    letter-spacing: 0;
    white-space: nowrap;
}

.guide-callout--markdown {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.right-item__copy span {
    overflow-wrap: anywhere;
    color: rgba(57, 84, 81, 0.6);
    font-size: clamp(10.5px, 2.85vw, 12.5px);
    letter-spacing: 0.01em;
    line-height: 1.35;
    white-space: normal;
}

.right-item__chevron {
    display: grid;
    width: 20px;
    height: 20px;
    color: rgba(57, 84, 81, 0.72);
    place-items: center;
    transition: transform 210ms ease-out;
}

.right-item__chevron svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.right-item.is-expanded .right-item__chevron {
    transform: rotate(180deg);
}

.right-item__panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 210ms ease-out, opacity 180ms ease-out;
}

.right-item__panel > div {
    min-height: 0;
    overflow: hidden;
}

.right-item.is-expanded .right-item__panel {
    grid-template-rows: 1fr;
    opacity: 1;
}

.right-item__details {
    margin: 0 17px 15px 110px;
    padding: 13px 0 1px;
    border-top: 1px solid rgba(57, 84, 81, 0.11);
}

.right-item__details p {
    margin: 0;
    color: rgba(57, 84, 81, 0.66);
    font-size: 12px;
    line-height: 1.55;
}

.right-item__details ul {
    margin: 0;
    padding-left: 18px;
    color: rgba(57, 84, 81, 0.66);
    font-size: 12px;
    line-height: 1.55;
}

.right-item__details li + li { margin-top: 7px; }

.right-item__details strong { color: rgba(57, 84, 81, 0.82); }

.right-item__details span {
    display: inline-flex;
    margin-top: 10px;
    padding: 5px 9px;
    border: 1px solid rgba(57, 84, 81, 0.09);
    border-radius: 999px;
    background: rgba(255, 253, 247, 0.48);
    color: rgba(57, 84, 81, 0.5);
    font-family: var(--utility-font);
    font-size: 9px;
    letter-spacing: 0.04em;
    line-height: 1;
}

.rights-detail__footer {
    display: grid;
    padding: 31px 0 9px;
    justify-items: center;
    gap: 9px;
    color: rgba(57, 84, 81, 0.55);
    text-align: center;
}

.rights-detail__footer > span {
    color: rgba(196, 160, 91, 0.7);
    font-family: var(--display-font);
    font-size: 13px;
    letter-spacing: 0.12em;
}

.rights-detail__footer p {
    margin: 0;
    font-size: clamp(11.5px, 3.1vw, 13px);
    letter-spacing: 0.035em;
    line-height: 1.4;
}

@media (max-width: 359px) {
    .gift-detail {
        padding-inline: 15px;
    }

    .gift-detail__header {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 7px;
    }

    .gift-detail__back,
    .gift-detail__header-spacer {
        width: 42px;
        height: 42px;
    }

    .birthday-pass__meta--top-left,
    .birthday-pass__meta--bottom-left {
        left: 19px;
    }

    .birthday-pass__meta--top-right,
    .birthday-pass__meta--bottom-right {
        right: 19px;
    }

    .birthday-pass__meta--top-left {
        top: 20px;
    }

    .birthday-pass__meta--top-right {
        top: 19px;
    }

    .birthday-pass__meta--bottom-left,
    .birthday-pass__meta--bottom-right {
        bottom: 18px;
    }

    .birthday-pass__center {
        top: 41px;
        bottom: 34px;
    }

    .rights-status {
        padding-inline: 13px;
        grid-template-columns: 43px minmax(0, 1fr) 33px;
        gap: 9px;
    }

    .rights-status__check {
        width: 42px;
        height: 42px;
    }

    .rights-status__gift svg {
        width: 32px;
        height: 32px;
    }

    .right-item__trigger {
        min-height: 91px;
        padding-inline: 12px;
        grid-template-columns: 52px 27px minmax(0, 1fr) 18px;
        gap: 7px;
    }

    .right-item__icon {
        width: 52px;
        height: 52px;
    }

    .right-item__icon svg {
        width: 38px;
        height: 38px;
    }

    .right-item__details {
        margin-left: 98px;
    }
}

@media (min-width: 540px) {
    .gift-detail-scene__surface {
        border-right: 1px solid rgba(57, 84, 81, 0.05);
        border-left: 1px solid rgba(57, 84, 81, 0.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gift-hub-scene__inner,
    .gift-detail-scene,
    .gift-detail-scene__surface,
    .birthday-pass-reveal {
        transition-duration: 101ms !important;
        transition-delay: 0s !important;
    }

    .birthday-pass:active {
        transform: none;
    }

    .right-item__panel,
    .right-item__chevron,
    .memory-view {
        transition-duration: 80ms !important;
    }
}
