:root {
    --ink: #26394b;
    --cream: #fff8e8;
    --paper: #fffdf6;
    --sky: #bfe6ef;
    --blue: #76bfd4;
    --coral: #ef806f;
    --yellow: #f5cb66;
    --mint: #8bcbb8;
    --green: #6fa273;
    --violet: #9c83bd;
    --shadow: 0 18px 50px rgba(38, 57, 75, .16);
    font-family: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
    color: var(--ink);
    background: var(--cream)
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(#ddf3f5 0, #fff8e8 70%);
    overflow-x: hidden
}

button {
    font: inherit;
    color: inherit
}

button:focus-visible,
a:focus-visible {
    outline: 4px solid #ffb62e;
    outline-offset: 4px
}

h1,
h2,
h3,
p {
    margin-top: 0
}

h1,
h2,
h3 {
    font-family: Georgia, serif;
    letter-spacing: -.04em
}

.noise {
    position: fixed;
    z-index: -1;
    inset: 0;
    opacity: .2;
    pointer-events: none;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 18px 18px
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: 68px;
    padding: 9px clamp(14px, 4vw, 48px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 253, 246, .9);
    border-bottom: 2px dashed rgba(38, 57, 75, .16);
    backdrop-filter: blur(14px)
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: none;
    font-weight: 900;
    cursor: pointer
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 2px 3px 0 var(--ink)
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.mission-count {
    margin-right: 8px;
    font-size: .78rem;
    font-weight: 900
}

.icon-button {
    min-width: 42px;
    height: 40px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 2px 3px 0 var(--ink)
}

.icon-button.active {
    background: var(--yellow);
    transform: translate(2px, 2px);
    box-shadow: none
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 50px;
    padding: 0 24px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--yellow);
    box-shadow: 4px 5px 0 var(--ink);
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: .18s
}

.button:hover {
    transform: translateY(-3px) rotate(-1deg);
    box-shadow: 6px 8px 0 var(--ink)
}

.button.ghost {
    background: var(--paper)
}

.text-button {
    padding: 10px;
    border: 0;
    background: none;
    font-weight: 900;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer
}

.eyebrow {
    margin-bottom: 12px;
    color: #ad4f46;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .13em
}

.lead {
    max-width: 640px;
    font: 1.22rem/1.65 Georgia, serif
}

.hero {
    position: relative;
    min-height: calc(100vh - 68px);
    padding: clamp(34px, 6vw, 80px);
    display: grid;
    grid-template-columns: .88fr 1.12fr;
    align-items: center;
    gap: 50px;
    overflow: hidden
}

.hero-copy {
    position: relative;
    z-index: 2
}

.hero h1 {
    max-width: 750px;
    margin-bottom: 24px;
    font-size: clamp(3.5rem, 7vw, 7rem);
    line-height: .92
}

.hero-picture {
    position: relative;
    z-index: 2
}

.hero-picture img {
    display: block;
    width: 100%;
    border: 4px solid var(--ink);
    border-radius: 44px 55px 46px 56px;
    box-shadow: 12px 15px 0 var(--ink), var(--shadow);
    transform: rotate(1.2deg)
}

.sticker {
    position: absolute;
    padding: 9px 14px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 3px 4px 0 var(--ink);
    font-size: .75rem;
    font-weight: 900
}

.sticker.s1 {
    left: -3%;
    bottom: 12%;
    transform: rotate(-7deg)
}

.sticker.s2 {
    right: -2%;
    top: 10%;
    background: #f8cdda;
    transform: rotate(8deg)
}

.tiny-things {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px
}

.tiny-things span {
    padding: 7px 11px;
    border: 1px solid rgba(38, 57, 75, .25);
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    font-size: .75rem;
    font-weight: 800
}

.cloud {
    position: absolute;
    color: #fff;
    font-size: 9rem;
    opacity: .65;
    animation: float 4s ease-in-out infinite alternate
}

.cloud.c1 {
    left: -3%;
    top: 1%
}

.cloud.c2 {
    right: 2%;
    bottom: 0;
    animation-delay: -2s
}

@keyframes float {
    to {
        transform: translateY(-15px)
    }
}

.map-screen {
    min-height: calc(100vh - 68px);
    padding: 55px clamp(16px, 5vw, 70px) 90px
}

.map-heading {
    max-width: 1160px;
    margin: 0 auto 35px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px
}

.map-heading h1 {
    max-width: 750px;
    margin: 0;
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: .95
}

.companion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px 9px 9px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 4px 5px 0 var(--ink)
}

.companion img {
    width: 70px;
    height: 70px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    object-fit: cover;
    object-position: center 40%
}

.companion p {
    margin: 0;
    font: italic .86rem/1.35 Georgia, serif
}

.chapter-grid {
    max-width: 1160px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px
}

.chapter-card {
    position: relative;
    min-height: 250px;
    padding: 22px;
    border: 3px solid var(--ink);
    border-radius: 26px;
    background: var(--paper);
    box-shadow: 6px 8px 0 var(--ink);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: .2s
}

.chapter-card:nth-child(4n+1) {
    background: #e9f6f6
}

.chapter-card:nth-child(4n+2) {
    background: #fff1cd
}

.chapter-card:nth-child(4n+3) {
    background: #f9dcd8
}

.chapter-card:nth-child(4n+4) {
    background: #e5f3e8
}

.chapter-card:hover {
    transform: translateY(-7px) rotate(-1deg)
}

.chapter-card.locked {
    opacity: .48;
    filter: saturate(.35);
    cursor: not-allowed
}

.chapter-card.complete::after {
    content: "✓";
    position: absolute;
    right: 13px;
    top: 13px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--mint);
    color: #fff;
    font-weight: 900
}

.chapter-icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    margin-bottom: 24px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
    font-size: 2rem
}

.card-no {
    display: block;
    margin-bottom: 7px;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .1em
}

.chapter-card h2 {
    font-size: 1.45rem;
    line-height: 1.05
}

.card-state {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 18px;
    font-size: .73rem;
    font-weight: 900
}

.complete .card-state {
    color: #3d7e69
}

.curious-strip {
    max-width: 920px;
    margin: 48px auto 0;
    padding: 22px 26px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    border: 3px solid var(--ink);
    border-radius: 28px;
    background: #ffe491;
    box-shadow: 7px 8px 0 var(--ink)
}

.monkey {
    font-size: 4.4rem
}

.curious-strip h2 {
    margin-bottom: 5px;
    font-size: 1.6rem
}

.curious-strip p {
    margin-bottom: 0
}

.banana-tray {
    display: flex;
    gap: 8px
}

.banana {
    width: 49px;
    height: 49px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
    box-shadow: 3px 3px 0 var(--ink);
    font-size: 1.35rem;
    cursor: pointer
}

.banana.found {
    background: var(--mint);
    transform: translate(2px, 2px);
    box-shadow: none
}

.map-final {
    text-align: center;
    margin-top: 42px
}

.chapter {
    min-height: calc(100vh - 68px);
    display: grid;
    grid-template-columns: minmax(330px, .78fr) minmax(520px, 1.22fr);
    background: var(--paper)
}

.story {
    position: relative;
    padding: clamp(35px, 6vw, 78px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 3px solid var(--ink);
    background: linear-gradient(145deg, #dff3f4, #fff0cf);
    overflow: hidden
}

.story h1 {
    max-width: 600px;
    margin-bottom: 26px;
    font-size: clamp(3rem, 5.7vw, 5.7rem);
    line-height: .94
}

.story>div>p:not(.eyebrow) {
    max-width: 570px;
    font: 1.08rem/1.75 Georgia, serif
}

.chapter-big-icon {
    display: block;
    margin-bottom: 28px;
    font-size: 4rem;
    filter: drop-shadow(4px 4px 0 rgba(38, 57, 75, .14))
}

.page-note {
    font: italic .85rem Georgia, serif
}

.story-avatar {
    display: block;
    width: min(410px, 90%);
    margin: 25px auto 0;
    border: 3px solid var(--ink);
    border-radius: 28px;
    box-shadow: 6px 7px 0 var(--ink);
    transform: rotate(-1deg)
}

.game-panel {
    padding: clamp(25px, 4vw, 55px);
    display: flex;
    flex-direction: column;
    min-width: 0
}

.game-panel header h2 {
    max-width: 760px;
    font-size: clamp(1.7rem, 3vw, 2.7rem)
}

.game {
    flex: 1;
    min-height: 450px;
    display: grid;
    place-items: center;
    border: 3px solid var(--ink);
    border-radius: 30px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden
}

.game-panel footer {
    display: flex;
    justify-content: space-between;
    margin-top: 18px
}

.game-inner {
    width: min(760px, 100%);
    padding: clamp(20px, 4vw, 42px);
    text-align: center
}

.status {
    min-height: 24px;
    margin: 22px 0 0;
    font: italic 1rem Georgia, serif
}

.success {
    padding: 40px;
    text-align: center
}

.reward-emoji {
    display: grid;
    place-items: center;
    width: 105px;
    height: 105px;
    margin: 0 auto 23px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 7px 8px 0 var(--ink);
    font-size: 3.2rem;
    animation: pop .45s both
}

.success h3 {
    font-size: 2.4rem
}

.success p {
    font: 1rem Georgia, serif
}

@keyframes pop {
    50% {
        transform: scale(1.08) rotate(-5deg)
    }
}

.sky-catcher {
    position: relative;
    height: 310px;
    border-radius: 22px;
    background: linear-gradient(#a8dce7 0 68%, #f6c987 68%);
    overflow: hidden
}

.sky-catcher button {
    position: absolute;
    z-index: 2;
    left: var(--x);
    top: var(--y);
    width: 64px;
    height: 64px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
    box-shadow: 4px 4px 0 var(--ink);
    font-size: 1.8rem;
    cursor: pointer;
    animation: float 1.5s infinite alternate
}

.sky-catcher button.caught {
    background: #f7c9d4;
    animation: none
}

.ny-skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -13px;
    color: #5b6d7a;
    font-size: 5.5rem;
    letter-spacing: -.25em
}

.sim-screen {
    height: 125px;
    margin-bottom: 20px;
    display: grid;
    place-items: center;
    border: 3px solid var(--ink);
    border-radius: 18px;
    background: #193f49;
    color: #abf3c7;
    font: 900 1rem monospace;
    text-shadow: 0 0 10px #abf3c7
}

.switch-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px
}

.switch-grid button {
    min-height: 88px;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: #e6edf0;
    font-weight: 900;
    cursor: pointer
}

.switch-grid button span {
    display: block;
    margin-bottom: 7px;
    font-size: 1.7rem
}

.switch-grid button.lit {
    background: var(--yellow);
    transform: translateY(-5px);
    box-shadow: 0 5px 0 var(--ink)
}

.race {
    position: relative;
    width: 100%;
    height: 450px;
    background: linear-gradient(90deg, #172b37 0 20%, #4d5559 20% 80%, #172b37 80%);
    overflow: hidden
}

.race::before,
.race::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 5px;
    background: repeating-linear-gradient(#fff 0 18px, #ef806f 18px 36px)
}

.race::before {
    left: 20%
}

.race::after {
    right: 20%
}

.track-lines {
    position: absolute;
    left: 50%;
    top: -100px;
    width: 4px;
    height: 700px;
    background: repeating-linear-gradient(#fff 0 30px, transparent 30px 80px);
    animation: road .7s linear infinite
}

.race-hud {
    position: absolute;
    z-index: 5;
    inset: 16px 20px auto;
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-weight: 900
}

.race-hud b {
    color: var(--yellow)
}

.racecar {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 35px;
    width: 55px;
    height: 98px;
    transform: translateX(-50%);
    border: 3px solid #fff;
    border-radius: 40% 40% 15% 15%;
    background: linear-gradient(90deg, #cf5e54, #ef806f, #cf5e54);
    transition: left .1s
}

.racecar::after {
    content: "22";
    position: absolute;
    left: 16px;
    top: 36px;
    color: #fff;
    font-weight: 900
}

.mobile-controls {
    position: absolute;
    z-index: 5;
    left: 15px;
    right: 15px;
    bottom: 15px;
    display: flex;
    justify-content: space-between
}

.mobile-controls button {
    width: 62px;
    height: 50px;
    border: 2px solid #fff;
    border-radius: 15px;
    color: #fff;
    background: rgba(0, 0, 0, .45);
    font-size: 1.4rem;
    cursor: pointer
}

@keyframes road {
    to {
        transform: translateY(80px)
    }
}

.hobby-shelf {
    padding-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    border-bottom: 12px solid #9b6d51
}

.hobby-shelf button {
    min-height: 120px;
    padding: 15px;
    border: 2px solid var(--ink);
    border-radius: 18px;
    background: #edf6f3;
    font-weight: 900;
    cursor: pointer;
    transition: .2s
}

.hobby-shelf button span {
    display: block;
    margin-bottom: 8px;
    font-size: 2.4rem
}

.hobby-shelf button.chosen {
    background: var(--yellow);
    transform: translateY(-8px) rotate(-2deg);
    box-shadow: 4px 6px 0 var(--ink)
}

.postcards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px
}

.postcards button {
    min-height: 145px;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: 18px;
    background: #fff0f0;
    box-shadow: 3px 4px 0 var(--ink);
    cursor: pointer
}

.postcards button span {
    display: block;
    font-size: 2rem
}

.postcards button b {
    display: block;
    margin: 7px
}

.postcards button small {
    display: block;
    font-family: Georgia, serif
}

.postcards button.open {
    background: #fff;
    border-color: #ca4c4c;
    transform: rotate(-1deg)
}

.jungle {
    position: relative;
    height: 330px;
    border-radius: 24px;
    background: linear-gradient(#a9dbd0, #d9edac);
    overflow: hidden
}

.jungle::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 70px;
    background: #78a864
}

.jungle-monkey {
    position: absolute;
    z-index: 2;
    left: 42%;
    bottom: 38px;
    font-size: 6rem
}

.jungle button {
    position: absolute;
    z-index: 3;
    left: var(--x);
    top: var(--y);
    border: 0;
    background: none;
    font-size: 2.2rem;
    cursor: pointer;
    filter: drop-shadow(2px 3px 0 rgba(38, 57, 75, .2));
    animation: float 1.1s infinite alternate
}

.jungle button.found {
    animation: none
}

.leaf {
    position: absolute;
    font-size: 5rem
}

.leaf.l1 {
    left: -10px;
    bottom: 20px
}

.leaf.l2 {
    right: -10px;
    top: 10px;
    transform: rotate(180deg)
}

.avatar-reunion {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 34px;
    transition: .7s
}

.avatar-card {
    width: 190px;
    transition: .8s
}

.avatar-card img {
    width: 190px;
    height: 245px;
    border: 3px solid var(--ink);
    border-radius: 95px 95px 24px 24px;
    object-fit: cover
}

.avatar-card.tall img {
    object-position: 36% center
}

.avatar-card.short {
    transform: scale(.87);
    transform-origin: bottom
}

.avatar-card.short img {
    object-position: 64% center
}

.avatar-card span {
    display: block;
    margin-top: 10px;
    font-weight: 900
}

.big-heart {
    align-self: center;
    width: 75px;
    height: 75px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: #f4b5c3;
    color: #b33e58;
    box-shadow: 5px 6px 0 var(--ink);
    font-size: 2.6rem;
    cursor: pointer;
    animation: float 1s infinite alternate
}

.avatar-reunion.together {
    gap: 0
}

.avatar-reunion.together .big-heart {
    transform: scale(1.35);
    background: var(--yellow)
}

.final-hero {
    min-height: calc(100vh - 68px);
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(#c9edf1, #fff0cf);
    overflow: hidden
}

.final-avatar {
    width: min(650px, 88vw);
    max-height: 52vh;
    object-fit: cover;
    border: 4px solid var(--ink);
    border-radius: 40px;
    box-shadow: 10px 12px 0 var(--ink);
    transform: rotate(-1deg)
}

.final-hero h1 {
    margin: 25px 0 12px;
    font-size: clamp(4rem, 9vw, 8rem);
    line-height: .88
}

.final-hero h1 em {
    color: #c85261
}

.polish {
    font: italic 1.25rem Georgia, serif
}

.confetti {
    margin-bottom: 20px;
    color: #c85261;
    font-size: 2rem;
    letter-spacing: .7em
}

.final-content {
    padding: 80px clamp(18px, 6vw, 90px) 100px;
    background: var(--cream)
}

.letter {
    max-width: 820px;
    margin: 0 auto 90px;
    padding: clamp(30px, 6vw, 70px);
    border: 2px solid #d6bf9c;
    background: #fffef9;
    box-shadow: var(--shadow);
    transform: rotate(-.35deg)
}

.letter h2 {
    font-size: 3rem
}

.letter p:not(.eyebrow):not(.signature) {
    font: 1.1rem/1.8 Georgia, serif
}

.signature {
    margin-top: 38px;
    white-space: pre-line;
    color: #b24d58;
    font: italic 1.3rem/1.6 Georgia, serif
}

.gallery-section,
.video-section {
    max-width: 1100px;
    margin: 0 auto 85px
}

.gallery-section h2 {
    font-size: clamp(2.4rem, 5vw, 4.5rem)
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px
}

.gallery figure {
    position: relative;
    min-height: 300px;
    margin: 0;
    padding: 10px 10px 42px;
    border: 2px solid var(--ink);
    background: #fff;
    box-shadow: 5px 6px 0 var(--ink);
    transform: rotate(-1deg)
}

.gallery figure:nth-child(even) {
    transform: rotate(1.3deg)
}

.gallery img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 245px;
    object-fit: cover
}

.gallery img.missing {
    display: none
}

.photo-fallback {
    position: absolute;
    inset: 10px 10px 42px;
    display: grid;
    place-items: center;
    background: repeating-linear-gradient(45deg, #e4f1ef 0 12px, #fff5df 12px 24px);
    font: italic 1rem Georgia, serif
}

.gallery figcaption {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 13px;
    text-align: center;
    font-family: Georgia, serif
}

.video-frame {
    position: relative;
    aspect-ratio: 16/9;
    border: 3px solid var(--ink);
    border-radius: 25px;
    overflow: hidden;
    background: #26394b;
    box-shadow: var(--shadow)
}

.video-frame video {
    position: absolute;
    z-index: 2;
    width: 100%;
    height: 100%
}

.video-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font: italic 1.1rem Georgia, serif
}

.final-actions {
    display: flex;
    justify-content: center;
    gap: 18px
}

.toast {
    position: fixed;
    z-index: 30;
    left: 50%;
    bottom: 24px;
    max-width: calc(100% - 30px);
    padding: 12px 20px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 4px 5px 0 var(--ink);
    font-weight: 900;
    transform: translate(-50%, 110px);
    transition: .3s
}

.toast.show {
    transform: translate(-50%, 0)
}

dialog {
    max-width: 430px;
    padding: 0;
    border: 3px solid var(--ink);
    border-radius: 25px;
    background: var(--paper);
    box-shadow: 7px 8px 0 var(--ink)
}

dialog::backdrop {
    background: rgba(38, 57, 75, .65);
    backdrop-filter: blur(5px)
}

dialog form {
    padding: 35px
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px
}

.reduced-motion * {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important
}

@media(max-width:1000px) {
    .hero {
        grid-template-columns: 1fr
    }

    .hero-picture {
        max-width: 720px;
        margin: auto
    }

    .hero-picture img {
        width: 100%
    }

    .chapter-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .chapter {
        grid-template-columns: 1fr
    }

    .story {
        border-right: 0;
        border-bottom: 3px solid var(--ink)
    }

    .game {
        min-height: 500px
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:650px) {

    .brand span:last-child,
    .mission-count {
        display: none
    }

    .hero {
        padding: 45px 20px
    }

    .hero h1 {
        font-size: 3.5rem
    }

    .sticker {
        font-size: .62rem
    }

    .map-heading {
        display: block
    }

    .companion {
        margin-top: 25px
    }

    .chapter-grid,
    .gallery {
        grid-template-columns: 1fr
    }

    .chapter-card {
        min-height: 225px
    }

    .curious-strip {
        grid-template-columns: 1fr;
        text-align: center
    }

    .banana-tray {
        justify-content: center
    }

    .story,
    .game-panel {
        padding: 28px 16px
    }

    .game {
        min-height: 460px
    }

    .switch-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .hobby-shelf {
        grid-template-columns: repeat(2, 1fr)
    }

    .postcards {
        grid-template-columns: 1fr
    }

    .avatar-reunion {
        gap: 8px
    }

    .avatar-card {
        width: 125px
    }

    .avatar-card img {
        width: 125px;
        height: 190px
    }

    .big-heart {
        width: 58px;
        height: 58px;
        font-size: 2rem
    }

    .gallery {
        max-width: 410px;
        margin: auto
    }

    .final-actions,
    .dialog-actions {
        flex-direction: column
    }
}

/* Step 1: birthday date gate */
body.gate-active {
    background: #fff8e8
}

.gate-active .topbar {
    display: none
}

.gate-active #app {
    min-height: 100vh
}

.birthday-gate {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-rows: minmax(560px, 1fr) auto;
    overflow: hidden;
    background: radial-gradient(circle at 50% 38%, #fffef9 0 19%, transparent 46%), linear-gradient(#dff3f4 0 64%, #fff8e8 64%)
}

.birthday-gate::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 0;
    right: 0;
    bottom: 225px;
    height: 3px;
    background: rgba(38, 57, 75, .13);
    box-shadow: 0 9px 24px rgba(38, 57, 75, .08)
}

.gate-sky span {
    position: absolute;
    z-index: 0;
    color: #ef806f;
    opacity: .45;
    animation: float 2s ease-in-out infinite alternate
}

.gate-sky span:nth-child(1) {
    left: 12%;
    top: 14%;
    font-size: 2.4rem
}

.gate-sky span:nth-child(2) {
    right: 17%;
    top: 11%;
    color: #f0b733;
    font-size: 3rem;
    animation-delay: -.7s
}

.gate-sky span:nth-child(3) {
    right: 7%;
    top: 37%;
    font-size: 1.7rem;
    animation-delay: -1.2s
}

.avatar-stage {
    position: relative;
    z-index: 2;
    min-height: 560px;
    width: 100%;
    align-self: end
}

.kamil-walker,
.girl-avatar {
    position: absolute;
    bottom: 0;
    background-repeat: no-repeat;
    filter: drop-shadow(0 14px 12px rgba(38, 57, 75, .12));
    will-change: left, background-position, transform
}

.kamil-walker {
    z-index: 3;
    left: -260px;
    width: 220px;
    height: 560px;
    background-image: url("assets/illustrations/kamil-walk-sprite.png");
    background-size: 400% 100%;
    background-position: 0 0
}

.kamil-walker.walking {
    animation: walkAcross 4.5s cubic-bezier(.35, .05, .25, 1) forwards, walkFrames .72s steps(4) infinite
}

.kamil-walker.at-center,
.kamil-walker.arrived {
    left: calc(50% - 210px);
    background-position: 0 0;
    animation: none
}

.girl-avatar {
    z-index: 2;
    left: calc(50% - 130px);
    width: 420px;
    height: 560px;
    background-image: url("assets/illustrations/girl-kiss-sprite.png");
    background-size: 200% 100%;
    background-position: 0 0;
    transition: transform .65s cubic-bezier(.2, .9, .25, 1.25)
}

.girl-avatar.kissing {
    z-index: 4;
    background-position: 100% 0;
    transform: translateX(-80px) rotate(-3deg)
}

.kiss-heart {
    position: absolute;
    z-index: 6;
    left: calc(50% - 35px);
    top: 155px;
    color: #d84f69;
    font-size: 0;
    opacity: 0;
    filter: drop-shadow(0 4px 0 #fff);
    transition: .4s .45s
}

.avatar-stage.kiss .kiss-heart {
    font-size: 4.2rem;
    opacity: 1;
    animation: kissPop 1s .35s ease-out both
}

.birthday-form {
    position: relative;
    z-index: 8;
    width: min(590px, calc(100% - 32px));
    margin: 0 auto 34px;
    padding: 24px 28px 26px;
    border: 3px solid var(--ink);
    border-radius: 28px;
    background: rgba(255, 253, 246, .96);
    box-shadow: 7px 9px 0 var(--ink), var(--shadow);
    text-align: center
}

.birthday-form label {
    display: block;
    margin-bottom: 15px;
    font: 700 clamp(1.25rem, 2.3vw, 1.65rem) Georgia, serif
}

.date-entry {
    display: flex;
    gap: 10px
}

.date-entry input {
    min-width: 0;
    flex: 1;
    height: 54px;
    padding: 0 18px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #fff;
    font: 800 1.05rem/1 monospace;
    text-align: center;
    letter-spacing: .08em
}

.date-entry input::placeholder {
    color: #a9a29a
}

.date-entry button {
    min-width: 145px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--yellow);
    box-shadow: 3px 4px 0 var(--ink);
    font-weight: 900;
    cursor: pointer
}

.date-entry button:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--ink)
}

.birthday-message {
    min-height: 20px;
    margin: 13px 0 0;
    color: #76706a;
    font-size: .82rem;
    font-weight: 800
}

.birthday-form.wrong {
    animation: formShake .35s
}

.birthday-form.wrong .birthday-message {
    color: #bb4050
}

.birthday-form.accepted {
    border-color: #5f9f83;
    background: #effaf4
}

.birthday-form.accepted .birthday-message {
    color: #39775e
}

.birthday-form.accepted .date-entry {
    opacity: .55
}

@keyframes walkAcross {
    from {
        left: -260px
    }

    to {
        left: calc(50% - 210px)
    }
}

@keyframes walkFrames {
    to {
        background-position: -400% 0
    }
}

@keyframes kissPop {
    0% {
        transform: scale(.1) rotate(-20deg)
    }

    55% {
        transform: scale(1.25) rotate(8deg)
    }

    100% {
        transform: scale(1) rotate(0)
    }
}

@keyframes formShake {
    25% {
        transform: translateX(-8px)
    }

    50% {
        transform: translateX(8px)
    }

    75% {
        transform: translateX(-4px)
    }
}

@media(max-width:700px) {
    .birthday-gate {
        grid-template-rows: minmax(430px, 1fr) auto
    }

    .avatar-stage {
        min-height: 430px;
        transform: scale(.76);
        transform-origin: bottom center;
        width: 132%;
        margin-left: -16%
    }

    .birthday-gate::after {
        bottom: 235px
    }

    .birthday-form {
        margin-bottom: 22px;
        padding: 20px 16px
    }

    .date-entry {
        flex-direction: column
    }

    .date-entry button {
        min-height: 50px
    }

    .kiss-heart {
        top: 105px
    }
}

.kamil-walker.walking {
    animation: walkAcross 4.5s cubic-bezier(.35, .05, .25, 1) forwards, walkFrames .72s steps(3) infinite
}

@keyframes walkFrames {
    to {
        background-position: 100% 0
    }
}

.birthday-gate {
    display: block;
    height: 100vh;
    min-height: 700px;
    background: radial-gradient(circle at 50% 40%, #fffef9 0 24%, #fff8e8 72%)
}

.birthday-gate::after {
    bottom: 188px
}

.avatar-stage {
    height: calc(100vh - 188px);
    min-height: 512px
}

.kamil-walker,
.girl-avatar {
    height: 520px;
    mix-blend-mode: multiply
}

.kamil-walker {
    width: 195px
}

.girl-avatar {
    width: 390px
}

.birthday-form {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    margin: 0
}

.birthday-form.wrong {
    animation: formShakeCentered .35s
}

.birthday-form.accepted {
    transform: translateX(-50%)
}

@keyframes formShakeCentered {
    25% {
        transform: translateX(calc(-50% - 8px))
    }

    50% {
        transform: translateX(calc(-50% + 8px))
    }

    75% {
        transform: translateX(calc(-50% - 4px))
    }
}

@media(max-width:700px) {
    .birthday-gate {
        height: 100svh;
        min-height: 650px
    }

    .avatar-stage {
        height: calc(100svh - 230px);
        min-height: 420px
    }

    .birthday-form {
        bottom: 14px
    }

    .kamil-walker,
    .girl-avatar {
        height: 500px
    }

    .kamil-walker {
        width: 188px
    }

    .girl-avatar {
        width: 375px
    }
}

.kamil-walker,
.girl-avatar {
    mix-blend-mode: normal
}

.kamil-walker {
    background-image: url("assets/illustrations/kamil-walk-sprite-transparent.png")
}

.girl-avatar {
    background-image: url("assets/illustrations/girl-kiss-sprite-transparent.png")
}

/* Exact pixel crops from the original couple-avatar.png — no regenerated characters. */
.kamil-walker.exact-avatar {
    width: 220px;
    height: 522px;
    background: none;
    overflow: visible;
    filter: none
}

.kamil-walker.exact-avatar>span {
    position: absolute;
    inset: 0;
    display: block;
    background: url("assets/illustrations/kamil-original-pixels.png") center/100% 100% no-repeat
}

.kamil-body {
    clip-path: polygon(42% 0, 100% 0, 91% 57%, 76% 61%, 27% 61%, 4% 56%, 0 25%, 24% 14%)
}

.kamil-leg.leg-left {
    clip-path: polygon(27% 54%, 54% 54%, 55% 96%, 34% 100%, 18% 97%, 25% 74%);
    transform-origin: 45% 55%
}

.kamil-leg.leg-right {
    clip-path: polygon(50% 54%, 80% 53%, 83% 97%, 66% 100%, 50% 96%, 51% 72%);
    transform-origin: 62% 55%
}

.kamil-walker.walking {
    background: none;
    animation: walkExact 4.5s cubic-bezier(.35, .05, .25, 1) forwards
}

.kamil-walker.walking .leg-left {
    animation: leftLeg .68s ease-in-out infinite alternate
}

.kamil-walker.walking .leg-right {
    animation: rightLeg .68s ease-in-out infinite alternate
}

.kamil-walker.at-center,
.kamil-walker.arrived {
    left: calc(50% - 155px);
    background: none;
    animation: none
}

.kamil-walker.at-center .kamil-leg,
.kamil-walker.arrived .kamil-leg {
    animation: none
}

.girl-avatar.exact-avatar {
    left: calc(50% + 2px);
    width: 183px;
    height: 480px;
    background: url("assets/illustrations/girl-original-pixels.png") center/100% 100% no-repeat;
    filter: none;
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 4% 100%, 7% 62%, 0 37%)
}

.girl-avatar.exact-avatar.kissing {
    background-image: url("assets/illustrations/girl-original-pixels.png");
    background-position: center;
    transform: translate(-108px, -10px) rotate(-8deg);
    transform-origin: 38% 25%
}

.kiss-heart {
    left: calc(50% - 18px);
    top: 165px
}

@keyframes walkExact {
    from {
        left: -250px
    }

    to {
        left: calc(50% - 155px)
    }
}

@keyframes leftLeg {
    from {
        transform: rotate(6deg)
    }

    to {
        transform: rotate(-7deg)
    }
}

@keyframes rightLeg {
    from {
        transform: rotate(-6deg)
    }

    to {
        transform: rotate(7deg)
    }
}

@media(max-width:700px) {
    .kamil-walker.exact-avatar {
        width: 204px;
        height: 484px
    }

    .girl-avatar.exact-avatar {
        width: 172px;
        height: 454px;
        left: calc(50% + 5px)
    }

    .kamil-walker.at-center,
    .kamil-walker.arrived {
        left: calc(50% - 148px)
    }

    .girl-avatar.exact-avatar.kissing {
        transform: translate(-100px, -8px) rotate(-8deg)
    }
}

.kamil-walker.exact-avatar>span {
    background-image: url("assets/illustrations/kamil-original-masked.png")
}

.girl-avatar.exact-avatar,
.girl-avatar.exact-avatar.kissing {
    background-image: url("assets/illustrations/girl-original-masked.png")
}

.girl-avatar.exact-avatar.kissing {
    transform: translate(-18px, -4px) rotate(-3deg)
}

@media(max-width:700px) {
    .girl-avatar.exact-avatar.kissing {
        transform: translate(-16px, -3px) rotate(-3deg)
    }
}

/* Image #1 is the sole avatar source. These are viewport crops of 1.png, not redrawn assets. */
.kamil-walker.source-one {
    width: 200px !important;
    height: 580px !important;
    background: none !important;
    filter: none !important;
    clip-path: none !important;
    overflow: visible
}

.kamil-walker.source-one>span {
    position: absolute;
    inset: 0;
    display: block;
    background: none !important;
    overflow: hidden
}

.kamil-walker.source-one img {
    position: absolute;
    width: 440px;
    height: auto;
    left: -50px;
    top: -35px;
    max-width: none
}

.kamil-walker.source-one .one-body {
    clip-path: polygon(0 0, 100% 0, 100% 64%, 0 64%)
}

.kamil-walker.source-one .one-leg-left {
    clip-path: polygon(24% 57%, 53% 57%, 54% 100%, 22% 100%);
    transform-origin: 39% 58%
}

.kamil-walker.source-one .one-leg-right {
    clip-path: polygon(48% 57%, 82% 57%, 83% 100%, 50% 100%);
    transform-origin: 64% 58%
}

.kamil-walker.source-one.walking {
    animation: walkSourceOne 4.5s cubic-bezier(.35, .05, .25, 1) forwards !important
}

.kamil-walker.source-one.walking .one-leg-left {
    animation: sourceLeftLeg .62s ease-in-out infinite alternate
}

.kamil-walker.source-one.walking .one-leg-right {
    animation: sourceRightLeg .62s ease-in-out infinite alternate
}

.kamil-walker.source-one.at-center,
.kamil-walker.source-one.arrived {
    left: calc(50% - 150px) !important;
    animation: none !important
}

.kamil-walker.source-one.at-center .one-leg,
.kamil-walker.source-one.arrived .one-leg {
    animation: none !important
}

.girl-avatar.source-one {
    left: calc(50% + 5px) !important;
    width: 205px !important;
    height: 535px !important;
    background: none !important;
    filter: none !important;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%) !important;
    overflow: hidden
}

.girl-avatar.source-one>img {
    position: absolute;
    width: 440px;
    height: auto;
    left: -195px;
    top: -100px;
    max-width: none
}

.girl-avatar.source-one.kissing {
    background: none !important;
    transform: translate(-18px, -4px) rotate(-3deg) !important;
    transform-origin: 38% 25%
}

.birthday-gate {
    background: #fdf3e4
}

@keyframes walkSourceOne {
    from {
        left: -230px
    }

    to {
        left: calc(50% - 150px)
    }
}

@keyframes sourceLeftLeg {
    from {
        transform: rotate(5deg)
    }

    to {
        transform: rotate(-6deg)
    }
}

@keyframes sourceRightLeg {
    from {
        transform: rotate(-5deg)
    }

    to {
        transform: rotate(6deg)
    }
}

@media(max-width:700px) {
    .kamil-walker.source-one {
        transform: scale(.9);
        transform-origin: bottom center
    }

    .girl-avatar.source-one {
        transform: scale(.9);
        transform-origin: bottom center
    }

    .girl-avatar.source-one.kissing {
        transform: translate(-16px, -3px) rotate(-3deg) scale(.9) !important
    }
}

/* Opening scene: the four supplied files are displayed unchanged. */
.birthday-gate {
    background: #f5d7be
}

.provided-girl,
.provided-boy {
    position: absolute;
    bottom: 0;
    height: 520px;
    width: auto;
    max-width: none;
    object-fit: contain;
    mix-blend-mode: multiply
}

.provided-girl {
    z-index: 3;
    left: calc(50% - 208px);
    transition: transform .75s cubic-bezier(.2, .9, .25, 1.15)
}

.provided-boy {
    z-index: 2;
    left: -380px
}

.provided-boy.walking {
    animation: providedWalk 4.5s linear forwards
}

.provided-boy.waiting,
.provided-boy.arrived {
    left: calc(50% - 316px)
}

.provided-girl.kissing {
    transform: translateX(-58px)
}

.avatar-stage.kiss .kiss-heart {
    left: calc(50% - 100px);
    top: 145px
}

.provided-boy,
.provided-girl {
    image-rendering: auto
}

@keyframes providedWalk {
    from {
        left: -380px
    }

    to {
        left: calc(50% - 316px)
    }
}

@media(max-width:700px) {

    .provided-girl,
    .provided-boy {
        height: 430px
    }

    .provided-girl {
        left: calc(50% - 172px)
    }

    .provided-boy.waiting,
    .provided-boy.arrived {
        left: calc(50% - 262px)
    }

    .provided-girl.kissing {
        transform: translateX(-48px)
    }

    @keyframes providedWalk {
        from {
            left: -300px
        }

        to {
            left: calc(50% - 262px)
        }
    }
}

.provided-girl,
.provided-boy {
    mix-blend-mode: normal
}

.provided-girl.kissing {
    transform: translateX(-14px)
}

@media(max-width:700px) {
    .provided-girl.kissing {
        transform: translateX(-12px)
    }
}

/* Match the supplied characters' visible bounds: boy slightly taller, both soles aligned. */
.provided-boy {
    height: 583px;
    bottom: -45px
}

.provided-boy.waiting,
.provided-boy.arrived {
    left: calc(50% - 340px)
}

@keyframes providedWalk {
    from {
        left: -405px
    }

    to {
        left: calc(50% - 340px)
    }
}

@media(max-width:700px) {
    .provided-boy {
        height: 482px;
        bottom: -37px
    }

    .provided-boy.waiting,
    .provided-boy.arrived {
        left: calc(50% - 282px)
    }

    @keyframes providedWalk {
        from {
            left: -330px
        }

        to {
            left: calc(50% - 282px)
        }
    }
}

/* Step 2: Kamil's perfect plate */
body.food-active {
    background: #f8e5d2
}

.food-active .topbar {
    display: none
}

.food-game-screen {
    min-height: 100vh;
    padding: clamp(22px, 3vw, 42px);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle at 50% 48%, #fffaf2 0 25%, #f8e5d2 72%);
    overflow: hidden
}

.food-title {
    text-align: center;
    position: relative;
    z-index: 5
}

.food-title h1 {
    margin-bottom: 8px;
    font-size: clamp(2.2rem, 4vw, 4.4rem)
}

.food-title p:last-child {
    margin-bottom: 4px
}

.food-board {
    position: relative;
    width: min(1180px, 100%);
    min-height: 650px;
    flex: 1
}

.food-choice-row {
    position: absolute;
    z-index: 8;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    justify-content: space-between;
    gap: 10px
}

.food-choice {
    width: clamp(105px, 15vw, 175px);
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 22px;
    background: transparent;
    cursor: grab;
    transition: .2s
}

.food-choice:hover {
    transform: translateY(-7px) rotate(-2deg);
    background: rgba(255, 255, 255, .65);
    border-color: var(--ink)
}

.food-choice.selected {
    opacity: .38;
    filter: grayscale(.45);
    pointer-events: none
}

.food-choice img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain
}

.food-choice span {
    display: block;
    margin-top: -7px;
    font-weight: 900;
    font-size: .82rem
}

.plate-zone {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 48%;
    width: min(520px, 48vw);
    aspect-ratio: 1;
    transform: translate(-50%, -35%);
    border-radius: 50%;
    transition: .2s
}

.plate-zone.dragover {
    filter: drop-shadow(0 0 22px #ef806f);
    transform: translate(-50%, -35%) scale(1.03)
}

.black-plate {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 16px rgba(38, 30, 25, .28))
}

.plated-foods {
    position: absolute;
    z-index: 3;
    inset: 13%;
    border-radius: 50%
}

.plated-food {
    position: absolute;
    width: 43%;
    height: 43%;
    object-fit: contain;
    transform: translate(-50%, -50%) rotate(var(--turn));
    filter: drop-shadow(0 7px 5px rgba(0, 0, 0, .35));
    animation: foodLand .35s cubic-bezier(.2, .9, .3, 1.3) both
}

.plated-steak {
    width: 47%;
    height: 47%
}

.plated-pasta {
    width: 45%;
    height: 45%
}

.plate-hint {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    color: #eee;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    pointer-events: none
}

.food-reaction {
    position: absolute;
    z-index: 6;
    right: -10px;
    bottom: 5px;
    width: 240px;
    text-align: center
}

.food-reaction img {
    width: 210px;
    height: 210px;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(38, 57, 75, .14))
}

.food-reaction img.pop {
    animation: reactionPop .42s
}

.food-reaction p {
    min-height: 48px;
    margin: 0;
    padding: 9px 12px;
    border: 2px solid var(--ink);
    border-radius: 18px;
    background: #fffdf6;
    box-shadow: 3px 4px 0 var(--ink);
    font-weight: 900
}

.food-finish {
    position: relative;
    z-index: 10;
    margin-top: -55px;
    opacity: .42;
    pointer-events: none
}

.food-finish.ready {
    opacity: 1;
    pointer-events: auto;
    animation: finishPulse .8s infinite alternate
}

@keyframes foodLand {
    from {
        opacity: 0;
        transform: translate(-50%, -80%) scale(.4) rotate(var(--turn))
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(var(--turn))
    }
}

@keyframes reactionPop {
    50% {
        transform: scale(1.1) rotate(3deg)
    }
}

@keyframes finishPulse {
    to {
        transform: translateY(-4px)
    }
}

@media(max-width:760px) {
    .food-game-screen {
        padding: 18px 10px 28px;
        overflow: auto
    }

    .food-title h1 {
        font-size: 2.25rem
    }

    .food-title p:last-child {
        font-size: .88rem
    }

    .food-board {
        min-height: 650px
    }

    .food-choice-row {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0
    }

    .food-choice {
        width: auto;
        padding: 2px
    }

    .food-choice span {
        font-size: .58rem
    }

    .plate-zone {
        top: 37%;
        width: min(390px, 92vw);
        transform: translate(-50%, -20%)
    }

    .plate-zone.dragover {
        transform: translate(-50%, -20%) scale(1.02)
    }

    .food-reaction {
        left: 50%;
        right: auto;
        bottom: 0;
        width: 210px;
        transform: translateX(-50%)
    }

    .food-reaction img {
        width: 155px;
        height: 155px
    }

    .food-reaction p {
        font-size: .78rem;
        min-height: 0
    }

    .food-finish {
        margin-top: -12px
    }
}

.food-reaction img {
    opacity: 0
}

.food-reaction img.shown {
    opacity: 1
}

.plated-food {
    width: 25%;
    height: 25%
}

.plated-steak,
.plated-pasta {
    width: 31%;
    height: 31%
}

.plated-mash {
    width: 27%;
    height: 27%
}

.plated-kebab,
.plated-hotdog {
    width: 35%;
    height: 35%
}

.plated-food {
    cursor: pointer
}

.food-choice-row.returning {
    border-radius: 24px;
    background: rgba(255, 255, 255, .72);
    outline: 3px dashed #ef806f;
    outline-offset: 6px
}

/* Step 3: friendship interview */
body.friend-active {
    background: #f7dfcb
}

.friend-active .topbar {
    display: none
}

.friend-game-screen {
    min-height: 100vh;
    padding: clamp(22px, 4vw, 50px);
    background: radial-gradient(circle at 50% 45%, #fffaf3 0 24%, #f7dfcb 72%);
    overflow: hidden
}

.friend-title {
    text-align: center
}

.friend-title h1 {
    margin-bottom: 8px;
    font-size: clamp(2.4rem, 5vw, 5rem)
}

.friend-stage {
    width: min(1240px, 100%);
    min-height: 650px;
    margin: auto;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(330px, 1.1fr) minmax(220px, 1fr);
    align-items: end;
    gap: 24px
}

.friend-character {
    text-align: center
}

.friend-character img {
    display: block;
    width: 100%;
    height: 560px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 14px 10px rgba(47, 33, 28, .18))
}

.friend-character b {
    display: inline-block;
    margin-top: -18px;
    padding: 8px 18px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #fffdf6;
    box-shadow: 3px 4px 0 var(--ink)
}

.candidate-friend img.arrive {
    animation: candidateArrive .55s cubic-bezier(.2, .85, .3, 1.2)
}

.friend-dialogue {
    align-self: center;
    padding: 26px;
    border: 3px solid var(--ink);
    border-radius: 28px;
    background: #fffdf6;
    box-shadow: 7px 8px 0 var(--ink)
}

.friend-dialogue>p:first-child {
    font: 700 1.3rem/1.4 Georgia, serif;
    text-align: center
}

.friend-answers {
    display: grid;
    gap: 12px
}

.friend-answers button {
    min-height: 58px;
    padding: 12px 15px;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: #fff;
    box-shadow: 2px 3px 0 var(--ink);
    font-weight: 900;
    cursor: pointer
}

.friend-answers button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #fff0c9
}

.friend-answers button.correct {
    background: #ccebd7
}

.friend-answers button.wrong {
    background: #f5c7c3
}

.friend-result {
    min-height: 48px;
    margin: 18px 0 8px;
    color: #ad4f46;
    font-weight: 900;
    text-align: center
}

.friend-next {
    width: 100%
}

.friend-complete {
    text-align: center
}

.friend-complete span {
    color: #c85261;
    font-size: 5rem
}

.friend-complete h2 {
    font-size: 2.2rem
}

@keyframes candidateArrive {
    from {
        opacity: 0;
        transform: translateX(150px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@media(max-width:780px) {
    .friend-game-screen {
        padding: 20px 10px;
        overflow: auto
    }

    .friend-stage {
        min-height: 720px;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        align-items: start
    }

    .friend-character img {
        height: 330px
    }

    .friend-dialogue {
        grid-column: 1/-1;
        grid-row: 2;
        padding: 18px;
        margin-top: -12px
    }

    .friend-character b {
        margin-top: -12px
    }

    .friend-title h1 {
        font-size: 2.3rem
    }
}

.friend-character b {
    display: none
}

.friend-stage {
    align-items: end
}

.kamil-friend img {
    height: 485px
}

.candidate-friend {
    position: relative
}

.candidate-friend img {
    height: 570px
}

.candidate-friend .friend-result {
    position: absolute;
    z-index: 8;
    left: -25px;
    right: 5px;
    bottom: calc(100% + 18px);
    min-height: 0;
    padding: 14px 16px;
    border: 2px solid var(--ink);
    border-radius: 20px;
    background: #fffdf6;
    box-shadow: 3px 4px 0 var(--ink);
    text-align: center
}

.candidate-friend .friend-result:after {
    content: "";
    position: absolute;
    right: 28px;
    bottom: -13px;
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    background: #fffdf6;
    transform: rotate(45deg)
}

.candidate-friend .friend-result:empty {
    display: none
}

@media(max-width:780px) {
    .kamil-friend img {
        height: 270px
    }

    .candidate-friend img {
        height: 335px
    }

    .candidate-friend .friend-result {
        left: -30px;
        right: 0;
        bottom: calc(100% + 10px);
        padding: 9px;
        font-size: .72rem
    }

    .friend-dialogue {
        margin-top: -2px
    }
}

.kamil-friend img,
.candidate-friend img {
    height: 540px
}

.friend-dialogue .friend-result {
    position: relative;
    min-height: 0;
    margin: 10px 0 18px;
    padding: 12px 15px;
    border: 2px solid var(--ink);
    border-radius: 18px;
    background: #fff7d9;
    box-shadow: 3px 4px 0 var(--ink);
    text-align: center
}

.friend-dialogue .friend-result:empty {
    display: none
}

.friend-dialogue .friend-result:after {
    content: "";
    position: absolute;
    right: -11px;
    top: 50%;
    width: 18px;
    height: 18px;
    border-top: 2px solid var(--ink);
    border-right: 2px solid var(--ink);
    background: #fff7d9;
    transform: translateY(-50%) rotate(45deg)
}

@media(max-width:780px) {

    .kamil-friend img,
    .candidate-friend img {
        height: 315px
    }

    .friend-dialogue .friend-result {
        font-size: .78rem
    }
}

/* Step 4: city memories */
body.memory-active {
    background: #e8f0ed
}

.memory-active .topbar {
    display: none
}

.memory-game-screen {
    min-height: 100vh;
    padding: clamp(22px, 4vw, 48px);
    background: radial-gradient(circle at 50% 40%, #fffdf7 0 22%, #e8f0ed 75%)
}

.memory-title {
    text-align: center
}

.memory-title h1 {
    margin-bottom: 8px;
    font-size: clamp(2.5rem, 5vw, 5rem)
}

.memory-card {
    width: min(1050px, 100%);
    min-height: 650px;
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: minmax(300px, 1.15fr) minmax(300px, .85fr);
    overflow: hidden;
    border: 3px solid var(--ink);
    border-radius: 32px;
    background: #fffdf7;
    box-shadow: 9px 10px 0 var(--ink)
}

.memory-photo-wrap {
    min-height: 620px;
    padding: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f1dfca, #d9e9e5)
}

.memory-photo-wrap img {
    display: block;
    width: 100%;
    height: 600px;
    object-fit: contain;
    filter: drop-shadow(0 14px 12px rgba(38, 57, 75, .16))
}

.memory-photo-wrap img.memory-arrive {
    animation: memoryArrive .5s ease-out
}

.memory-question {
    align-self: center;
    padding: clamp(25px, 5vw, 55px)
}

.memory-count {
    color: #ad4f46;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em
}

.memory-question label {
    display: block;
    margin-bottom: 16px;
    font: 700 clamp(1.5rem, 3vw, 2.2rem) Georgia, serif
}

.memory-entry {
    display: flex;
    gap: 10px
}

.memory-entry input {
    min-width: 0;
    flex: 1;
    height: 56px;
    padding: 0 18px;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: #fff;
    font: 800 1rem Georgia, serif
}

.memory-entry button {
    padding: 0 20px;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: var(--yellow);
    box-shadow: 3px 4px 0 var(--ink);
    font-weight: 900;
    cursor: pointer
}

.memory-feedback {
    min-height: 28px;
    margin: 18px 0 22px;
    font-weight: 900
}

.memory-feedback.correct {
    color: #39775e
}

.memory-feedback.wrong {
    color: #bb4050
}

.memory-progress {
    display: flex;
    gap: 8px
}

.memory-progress span {
    width: 28px;
    height: 8px;
    border-radius: 99px;
    background: #d6d0c8
}

.memory-progress span.current {
    background: var(--yellow);
    outline: 2px solid var(--ink)
}

.memory-progress span.done {
    background: #75aa8e
}

.memory-complete {
    grid-column: 1/-1;
    align-self: center;
    padding: 60px;
    text-align: center
}

.memory-complete span {
    color: #c85261;
    font-size: 6rem
}

.memory-complete h2 {
    font-size: clamp(2.2rem, 5vw, 4rem)
}

@keyframes memoryArrive {
    from {
        opacity: 0;
        transform: scale(.94)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.memory-question form.shake {
    animation: formShake .35s
}

@media(max-width:760px) {
    .memory-game-screen {
        padding: 18px 10px 30px
    }

    .memory-card {
        min-height: 0;
        grid-template-columns: 1fr;
        margin-top: 15px
    }

    .memory-photo-wrap {
        min-height: 390px;
        padding: 10px
    }

    .memory-photo-wrap img {
        height: 380px
    }

    .memory-question {
        padding: 22px
    }

    .memory-entry {
        flex-direction: column
    }

    .memory-entry button {
        min-height: 52px
    }

    .memory-progress span {
        flex: 1
    }
}

/* Final letter: a sealed scroll that opens into the birthday note */
.letter-stage {
    position: relative;
    min-height: 980px;
    margin: 0 auto 100px;
    display: grid;
    place-items: center;
    isolation: isolate;
    overflow: hidden
}

.closed-scroll {
    position: relative;
    z-index: 4;
    width: min(470px, 72vw);
    height: 560px;
    padding: 38px 30px;
    border: 0;
    background: none;
    color: #50341f;
    cursor: pointer;
    filter: drop-shadow(0 18px 14px rgba(62, 39, 20, .25));
    transition: transform .5s ease, opacity .45s ease
}

.closed-scroll:hover {
    transform: translateY(-7px) rotate(-1deg)
}

.scroll-cover {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border: 2px solid #9a693b;
    background: linear-gradient(90deg, #d7a963, #f3d69a 13%, #f8e3af 50%, #edcb88 87%, #c99751);
    box-shadow: inset 0 0 45px rgba(91, 54, 22, .22)
}

.scroll-cover:before {
    content: "♥";
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ad4f46;
    color: #f8dfae;
    box-shadow: 0 4px 0 #71352f;
    font-size: 2rem
}

.scroll-cover b {
    font: italic 700 clamp(2rem, 5vw, 3.4rem) Georgia, serif
}

.scroll-cover i {
    font: 1.05rem Georgia, serif
}

.scroll-roll {
    position: absolute;
    z-index: 2;
    left: 0;
    width: 100%;
    height: 58px;
    border: 2px solid #895b32;
    border-radius: 50%;
    background: linear-gradient(#f2d89f, #bd8546 50%, #e4bd78);
    box-shadow: 0 7px 8px rgba(65, 38, 17, .25)
}

.top-roll {
    top: 10px
}

.bottom-roll {
    bottom: 10px
}

.closed-scroll.opening {
    transform: scale(.88) rotate(2deg);
    opacity: 0
}

.opened-letter {
    position: relative;
    z-index: 3;
    width: min(820px, 70vw);
    max-width: none;
    margin: 0;
    padding: clamp(38px, 6vw, 72px);
    overflow-wrap: anywhere;
    background: linear-gradient(90deg, #ead09a, #fff3cb 7%, #fff9df 50%, #f7e4b7 93%, #d9b477);
    border-color: #aa7946;
    box-shadow: 0 20px 40px rgba(62, 39, 20, .25), inset 0 0 55px rgba(113, 70, 31, .12);
    transform: none
}

.opened-letter:before,
.opened-letter:after {
    content: "";
    position: absolute;
    left: -15px;
    right: -15px;
    height: 30px;
    border: 2px solid #966438;
    border-radius: 50%;
    background: linear-gradient(#e6c17b, #bc8244 52%, #e5c485)
}

.opened-letter:before {
    top: -16px
}

.opened-letter:after {
    bottom: -16px
}

.opened-letter.revealed {
    animation: unrollLetter .75s cubic-bezier(.2, .75, .25, 1)
}

.opened-letter h2 {
    font-size: clamp(1.8rem, 4vw, 3rem)
}

.opened-letter p:not(.eyebrow) {
    font: 1.08rem/1.8 Georgia, serif
}

.letter-avatar {
    position: absolute;
    z-index: 2;
    width: clamp(150px, 18vw, 270px);
    height: 300px;
    object-fit: contain;
    filter: drop-shadow(0 12px 8px rgba(50, 33, 22, .2));
    pointer-events: none
}

.avatar-one {
    left: 0;
    top: 30px;
    transform: rotate(-8deg)
}

.avatar-two {
    right: 0;
    top: 25px;
    transform: rotate(8deg)
}

.avatar-three {
    left: 0;
    top: 365px;
    transform: rotate(-6deg)
}

.avatar-four {
    right: 0;
    top: 380px;
    transform: rotate(6deg)
}

.avatar-five {
    right: 5%;
    bottom: 5px;
    width: 230px;
    height: 245px;
    transform: rotate(4deg);
    border-radius: 24px
}

.letter-stage:has(.opened-letter.revealed) .letter-avatar {
    animation: avatarFloat 3.5s ease-in-out infinite alternate
}

.letter-stage:has(.opened-letter.revealed) .avatar-two,
.letter-stage:has(.opened-letter.revealed) .avatar-four {
    animation-delay: -1.7s
}

@keyframes unrollLetter {
    from {
        opacity: 0;
        transform: scaleY(.12)
    }

    to {
        opacity: 1;
        transform: scaleY(1)
    }
}

@keyframes avatarFloat {
    to {
        translate: 0 -9px
    }
}

@media(max-width:760px) {
    .letter-stage {
        min-height: 1120px;
        margin-bottom: 70px;
        padding: 145px 0 155px;
        overflow: visible
    }

    .closed-scroll {
        width: min(390px, 86vw);
        height: 500px
    }

    .opened-letter {
        width: 92vw;
        padding: 45px 25px
    }

    .opened-letter p:not(.eyebrow) {
        font-size: 1rem;
        line-height: 1.7
    }

    .letter-avatar {
        width: 145px;
        height: 175px
    }

    .avatar-one {
        left: -20px;
        top: 0
    }

    .avatar-two {
        right: -20px;
        top: 5px
    }

    .avatar-three {
        left: -25px;
        top: auto;
        bottom: 0
    }

    .avatar-four {
        right: -20px;
        top: auto;
        bottom: 5px
    }

    .avatar-five {
        right: 50%;
        bottom: -65px;
        width: 135px;
        height: 145px;
        transform: translateX(50%) rotate(3deg)
    }
}

.simple-final-hero {
    min-height: 72vh
}

.simple-final-hero h1 {
    margin-top: 18px
}

.opened-letter h2,
.opened-letter p:not(.eyebrow) {
    font-family: "Segoe Script", "Lucida Handwriting", "Brush Script MT", cursive
}

.opened-letter h2 {
    color: #943f4c;
    line-height: 1.35
}

.opened-letter p:not(.eyebrow) {
    font-size: 1.16rem;
    line-height: 2;
    letter-spacing: .01em
}

.avatar-six {
    left: 6%;
    bottom: 0;
    width: 240px;
    height: 250px;
    transform: rotate(-4deg);
    border-radius: 24px
}

.friend-reveal {
    grid-column: 1/-1;
    align-self: center;
    width: min(620px, 100%);
    margin: auto;
    text-align: center
}

.friend-reveal img {
    display: block;
    width: min(390px, 80vw);
    height: 390px;
    margin: 0 auto 15px;
    object-fit: contain;
    filter: drop-shadow(0 14px 10px rgba(47, 33, 28, .18));
    animation: candidateArrive .6s cubic-bezier(.2, .85, .3, 1.2)
}

.friend-reveal h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3rem)
}

.friend-reveal p {
    margin: 10px 0;
    color: #ad4f46;
    font: 900 clamp(1.2rem, 3vw, 2rem) Georgia, serif
}

@media(max-width:760px) {
    .opened-letter p:not(.eyebrow) {
        font-size: 1rem;
        line-height: 1.8
    }

    .avatar-six {
        left: 50%;
        bottom: 72px;
        width: 125px;
        height: 135px;
        transform: translateX(-50%) rotate(-3deg)
    }

    .friend-reveal img {
        height: 300px
    }

    .simple-final-hero {
        min-height: 68vh
    }
}

.avatar-seven {
    left: 0;
    top: 365px;
    transform: rotate(-6deg)
}

@media(max-width:760px) {
    .avatar-seven {
        left: -25px;
        top: auto;
        bottom: 5px;
        width: 145px;
        height: 175px
    }
}