/* Photo Memories studio — pinned polaroids on a warm wooden wall.
   Mirrors the Android gallery redesign (memories_wood_wall + PinnedPolaroid). */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --paper: #fffdf4;
    --paper-ink: #4a3b2c;
    --cream: #fff3de;
    --lilac: #8f76f0;
    --error: #d94b4b;
}

html, body { min-height: 100%; }

body {
    font-family: 'Kumbh Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #3d2a16 url('/static/memories-wall.jpg') center top / cover fixed;
    color: var(--paper-ink);
}

.hidden { display: none !important; }

.wall {
    max-width: 720px;
    margin: 0 auto;
    padding: 18px 16px 120px;
    min-height: 100vh;
}

/* ---------- Header ---------- */

.studio-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
}

.round-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #211b32;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    box-shadow: 0 3px 9px rgba(20, 10, 0, 0.35);
    flex: none;
}

.titles { flex: 1; }
.titles h1 {
    font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
    color: var(--cream);
    text-shadow: 0 2px 8px rgba(30, 15, 0, 0.55);
}
.titles p {
    font-size: 12.5px; font-weight: 600;
    color: rgba(255, 243, 222, 0.8);
    text-shadow: 0 1px 6px rgba(30, 15, 0, 0.5);
}

.quota-pill {
    background: #fff;
    border-radius: 999px;
    padding: 7px 13px 7px 10px;
    font-size: 13px; font-weight: 800;
    color: #211b32;
    display: inline-flex; align-items: center; gap: 6px;
    box-shadow: 0 3px 9px rgba(20, 10, 0, 0.35);
}
.quota-pill i { color: var(--lilac); font-size: 12px; }

/* ---------- Cards / notes ---------- */

.note-card {
    background: var(--paper);
    border-radius: 6px;
    box-shadow: 0 10px 26px rgba(25, 12, 0, 0.45);
    padding: 26px 20px;
    text-align: center;
    margin: 34px auto 0;
    max-width: 420px;
    transform: rotate(-0.8deg);
}
.note-card h2 { font-size: 19px; font-weight: 800; }
.note-card p { margin-top: 8px; font-size: 14px; color: rgba(74, 59, 44, 0.75); line-height: 1.5; }

.loading {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    color: var(--cream);
    text-shadow: 0 1px 6px rgba(30, 15, 0, 0.5);
    font-size: 14px; font-weight: 600;
    padding: 40px 0;
}

.spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(255, 243, 222, 0.35);
    border-top-color: var(--cream);
    animation: spin 0.9s linear infinite;
    flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- The board ---------- */

.board { column-count: 2; column-gap: 16px; }
@media (min-width: 560px) { .board { column-count: 3; } }

.polaroid {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 0 0 20px;
    background: var(--paper);
    border-radius: 4px;
    padding: 7px 7px 10px;
    box-shadow: 0 10px 24px rgba(25, 12, 0, 0.5);
    break-inside: avoid;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.polaroid:hover { transform: scale(1.02) rotate(0deg) !important; }

.polaroid img {
    width: 100%;
    display: block;
    border-radius: 2px;
    background: #eee3f2;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.polaroid.hero { column-span: all; }
.polaroid.hero img { aspect-ratio: 4 / 3; }

.polaroid .pin {
    position: absolute;
    top: -9px; left: 50%;
    width: 16px; height: 16px;
    transform: translateX(-50%);
    border-radius: 50%;
    box-shadow: inset -2px -3px 4px rgba(0,0,0,0.35), inset 2px 2px 3px rgba(255,255,255,0.5), 0 4px 5px rgba(0,0,0,0.4);
}

.polaroid .date {
    margin-top: 7px;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
}
.polaroid .cap {
    font-family: 'Caveat', cursive;
    text-align: center;
    font-size: 16px;
    line-height: 1.15;
    color: rgba(74, 59, 44, 0.72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.polaroid .badge {
    position: absolute;
    top: 14px; right: 14px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.polaroid .badge.pending { background: rgba(143, 118, 240, 0.9); animation: spin 1.4s linear infinite; }

/* ---------- Create FAB ---------- */

.create-fab {
    position: fixed;
    left: 50%; bottom: 26px;
    transform: translateX(-50%);
    border: none;
    font-family: inherit;
    background: linear-gradient(#d9cffa, #8f76f0);
    color: #fff;
    font-size: 15.5px; font-weight: 800;
    padding: 15px 28px;
    border-radius: 999px;
    display: inline-flex; align-items: center; gap: 9px;
    white-space: nowrap;
    box-shadow: 0 10px 26px rgba(70, 40, 140, 0.55);
    cursor: pointer;
    z-index: 30;
}
.create-fab:disabled { filter: saturate(0.2) brightness(1.05); cursor: default; }

/* ---------- Create flow: full soft-sky page (matches native "New memory") --- */

.create-page {
    position: fixed; inset: 0;
    z-index: 50;
    display: flex; flex-direction: column;
    background:
        radial-gradient(1100px 460px at 85% -80px, rgba(255, 214, 150, 0.22), transparent 60%),
        radial-gradient(900px 520px at 8% -40px, rgba(120, 180, 230, 0.22), transparent 58%),
        #f3f6fa;
    padding: 0;
}

/* MemoryWebActivity already owns the app-level title bar. Keep that native
   header and font, and avoid repeating "Memories / little moments" below it. */
body.app-embed .wall > .studio-header { display: none; }
.create-page .studio-header { padding: 14px 12px 10px; }
.create-page .titles h1 { color: #211b32; text-shadow: none; font-size: 22px; }
.create-page .titles p { color: #6b6480; text-shadow: none; }
.create-page .round-btn { color: #211b32; box-shadow: 0 3px 9px rgba(30, 50, 80, 0.14); }
.create-page .quota-pill { box-shadow: 0 3px 9px rgba(30, 50, 80, 0.14); }

.create-scroll {
    flex: 1; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; gap: 14px;
    padding: 0 16px 12px;
    max-width: 460px; width: 100%; margin: 0 auto;
}

.create-footer {
    max-width: 460px; width: 100%; margin: 0 auto;
    padding: 12px 16px;
}
.create-footer .cta { width: 100%; }

.preview-card {
    background: #fff;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 6px 16px rgba(46, 30, 80, 0.16);
    padding: 5px;
}
.preview-card img {
    width: 100%;
    border-radius: 16px;
    max-height: 250px;
    object-fit: cover;
    display: block;
    background: #eee3f2;
}

.loading.dark { color: #6b6480; text-shadow: none; padding: 8px 0; }
.loading.dark .spinner { border-color: rgba(143, 118, 240, 0.25); border-top-color: var(--lilac); }

.scene-chip {
    align-self: flex-start;
    background: rgba(143, 118, 240, 0.1);
    color: #6b57c9;
    font-size: 12.5px; font-weight: 700;
    border-radius: 999px;
    padding: 7px 13px;
}

/* ---------- Overlays (memory detail) ---------- */

.overlay {
    position: fixed; inset: 0;
    background: rgba(20, 10, 0, 0.6);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 50;
}
@media (min-width: 560px) { .overlay { align-items: center; } }

.sheet {
    position: relative;
    background: var(--paper);
    width: 100%;
    max-width: 460px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    padding: 22px 18px 26px;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
}
@media (min-width: 560px) { .sheet { border-radius: 18px; } }

.sheet h2 { font-size: 18px; font-weight: 800; margin-bottom: 14px; padding-right: 34px; }

.sheet-close {
    position: absolute; top: 12px; right: 12px;
    width: 36px; height: 36px;
    border: none; border-radius: 50%;
    background: rgba(74, 59, 44, 0.08);
    color: var(--paper-ink);
    font-size: 15px;
    cursor: pointer;
}

.step { display: flex; flex-direction: column; gap: 12px; }

.drop {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    border: 2px dashed rgba(143, 118, 240, 0.55);
    border-radius: 14px;
    background: rgba(143, 118, 240, 0.06);
    padding: 42px 16px;
    cursor: pointer;
    color: var(--lilac);
    font-weight: 700;
}
.drop i { font-size: 30px; }
.drop input { display: none; }

.pick-preview, .result-img, .detail-media {
    width: 100%;
    border-radius: 10px;
    max-height: 46vh;
    object-fit: contain;
    background: #211b32;
}

/* Cast picker — who appears in this keepsake. Chips rather than a list: the
   choice is small, visual, and should read as a row of faces you tap. */
.cast-picker { display: flex; flex-direction: column; gap: 7px; }

.cast-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 700;
    color: #6b6480;
}
.cast-count { font-weight: 600; font-size: 11.5px; color: #8b83a3; }

/* Scrolls sideways rather than wrapping to three rows on a 20-strong roster,
   and keeps the create sheet's own height stable. */
.cast-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: none;
}
.cast-chips::-webkit-scrollbar { display: none; }

.cast-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(58, 46, 102, 0.12);
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(46, 30, 80, 0.10);
    padding: 5px 13px 5px 5px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #211b32;
    cursor: pointer;
}
.cast-chip img,
.cast-chip .cast-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: #ece7fb;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    color: #6f5fd0;
}
.cast-chip.active {
    border-color: var(--lilac);
    border-width: 2px;
    background: #f3eeff;
    box-shadow: 0 7px 18px rgba(143, 118, 240, 0.33);
    padding: 4px 12px 4px 4px;
}
/* At the cap the unpicked chips stay visible but plainly unavailable, so the
   limit explains itself instead of taps silently doing nothing. */
.cast-chip[disabled] { opacity: 0.4; cursor: default; }
.cast-chip:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.cast-chip.active:focus-visible { outline: none; }

.idea-list { display: flex; flex-direction: column; gap: 9px; }

.idea {
    border: 1px solid rgba(58, 46, 102, 0.12);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(46, 30, 80, 0.10);
    text-align: left;
    padding: 11px 14px;
    font-family: inherit;
    color: var(--paper-ink);
    cursor: pointer;
}
.idea b { display: block; font-size: 15px; font-weight: 800; color: #211b32; margin-bottom: 3px; }
.idea span { display: block; color: #6b6480; font-size: 12.5px; line-height: 17px; }
.idea.active {
    border-color: var(--lilac);
    border-width: 2px;
    background: #f3eeff;
    box-shadow: 0 7px 18px rgba(143, 118, 240, 0.33);
}
.idea:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.idea.active:focus-visible { outline: none; }

.text-input {
    font-family: inherit;
    resize: vertical;
    min-height: 72px;
    font-size: 14px;
    color: #211b32;
    border: 1px solid rgba(58, 46, 102, 0.12);
    border-radius: 16px;
    padding: 11px 14px;
    background: #fff;
}
.text-input:focus { outline: 2px solid var(--lilac); outline-offset: -2px; }

/* Optional "how should they move" line, shown beside either animate button. */
.motion-input { width: 100%; box-sizing: border-box; min-height: 56px; margin-top: 10px; }

.cta {
    border: none;
    font-family: inherit;
    background: linear-gradient(#d9cffa, #8f76f0);
    color: #fff;
    font-size: 15px; font-weight: 800;
    padding: 14px 22px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none;
}
.create-footer .cta:not(:disabled) { box-shadow: 0 8px 20px rgba(143, 118, 240, 0.33); }
.cta:disabled { filter: saturate(0.25); cursor: default; }

.ghost {
    border: none; background: none;
    font-family: inherit;
    color: var(--lilac);
    font-size: 14px; font-weight: 700;
    padding: 11px;
    cursor: pointer;
}

.danger {
    border: none; background: none;
    font-family: inherit;
    color: var(--error);
    font-size: 13.5px; font-weight: 700;
    padding: 11px;
    cursor: pointer;
}

.result-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }

.detail-caption {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    text-align: center;
    margin-top: 10px;
    color: rgba(74, 59, 44, 0.8);
}

.detail-status {
    text-align: center;
    font-size: 13px; font-weight: 700;
    color: var(--lilac);
    padding: 8px;
}

.toast {
    position: fixed;
    left: 50%; bottom: 96px;
    transform: translateX(-50%);
    background: rgba(33, 27, 50, 0.94);
    color: #fff;
    font-size: 13.5px; font-weight: 600;
    border-radius: 999px;
    padding: 10px 18px;
    z-index: 80;
    max-width: 88vw;
    text-align: center;
}

/* Result step: Done sits beside the video CTA — an equal exit, not a footnote. */
.result-actions.row { flex-direction: row; gap: 10px; }
.result-actions.row > * { flex: 1; }
.result-actions.row .cta { flex: 1.4; white-space: nowrap; padding-inline: 14px; }
.secondary {
    border: 1.5px solid rgba(143, 118, 240, 0.5);
    background: #fff;
    color: var(--lilac);
    font-family: inherit;
    font-size: 15px; font-weight: 800;
    padding: 13px 18px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

/* ---------- Empty state: showcase + guide ---------- */
.showcase {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 16px;
    aspect-ratio: 560 / 1003;
    /* Leaves room for the how-it-works list above the fixed create button. */
    max-height: 36vh;
    border-radius: 14px;
    overflow: hidden;
    background: #eee3f2;
    box-shadow: 0 8px 20px rgba(25, 12, 0, 0.35);
}
.showcase-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.showcase-img.show { opacity: 1; }
.showcase-tag {
    position: absolute; top: 8px; left: 8px;
    background: rgba(255,255,255,.85);
    color: var(--paper-ink);
    font-size: 10px; font-weight: 700;
    border-radius: 999px;
    padding: 3px 9px;
}
.showcase-label {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 22px 10px 9px;
    background: linear-gradient(transparent, rgba(33,27,50,.72));
    color: #fff;
    font-size: 12.5px; font-weight: 700;
    transition: opacity 0.3s ease;
}

/* ---------- Making it obvious how this works ---------- */

/* Photos left today + Crystal balance, above the wall. */
.status-strip {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: -4px 0 14px;
}
.status-strip > span {
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px 6px 10px;
    font-size: 12.5px; font-weight: 700;
    color: #211b32;
    display: inline-flex; align-items: center; gap: 6px;
    box-shadow: 0 3px 9px rgba(20, 10, 0, 0.3);
}
.status-strip i { color: var(--lilac); font-size: 11.5px; }

.wall-tip {
    color: var(--cream);
    text-shadow: 0 1px 6px rgba(30, 15, 0, 0.6);
    font-size: 13px; font-weight: 600;
    margin: 0 0 16px;
}

/* Empty state: the wall itself. One example memory pinned beside an empty
   film with a big +. Same wood and polaroids as a full wall; the empty film
   is the thing to tap. */
.starter { max-width: 440px; margin: 6px auto 0; }
.starter-pair {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px; align-items: start;
    padding-top: 10px;
}
.starter .polaroid { margin: 0; }
.starter .sample { transform: rotate(-3deg); }
.starter .add {
    transform: rotate(2.5deg);
    border: 0; font: inherit; color: inherit;
    text-align: center;
}
.starter .showcase {
    max-width: none; max-height: none; margin: 0;
    border-radius: 2px; box-shadow: none;
}
.starter .showcase-label { font-size: 11px; padding: 18px 6px 7px; text-align: center; }
.starter .showcase-tag { font-size: 9.5px; }
.add-film {
    display: grid; place-items: center;
    aspect-ratio: 560 / 1003;
    border-radius: 2px;
    background: #f1ebdd;
    border: 2px dashed rgba(74, 59, 44, 0.25);
}
.add-film .plus {
    width: 58px; height: 58px; border-radius: 50%;
    background: linear-gradient(#d9cffa, #8f76f0);
    color: #fff; font-size: 24px;
    display: grid; place-items: center;
    box-shadow: 0 8px 18px rgba(70, 40, 140, 0.4);
    transition: transform 0.15s ease;
}
.starter .add:hover .plus { transform: scale(1.06); }
.starter .add:focus-visible { outline: 3px solid var(--lilac); outline-offset: 4px; }
.starter .add:disabled { cursor: default; }
.starter .add:disabled .plus { filter: saturate(0.2); }
.starter .cap { margin-top: 6px; font-size: 18px; }
.starter-hint {
    margin-top: 24px;
    text-align: center;
    color: var(--cream);
    text-shadow: 0 2px 8px rgba(30, 15, 0, 0.6);
    font-size: 15px; font-weight: 800;
}
@media (prefers-reduced-motion: reduce) { .add-film .plus { transition: none; } }

/* Create-flow progress: which of the four steps you're on. */
.stepper {
    list-style: none;
    display: flex; gap: 6px;
    max-width: 460px; width: 100%;
    margin: 0 auto 12px;
    padding: 0 16px;
}
.stepper li {
    flex: 1;
    font-size: 11.5px; font-weight: 700;
    color: #a39cb8;
    padding-top: 7px;
    border-top: 3px solid rgba(143, 118, 240, 0.18);
    white-space: nowrap;
}
.stepper li b { font-weight: 800; margin-right: 2px; }
.stepper li.done { color: #8b7fd0; border-top-color: rgba(143, 118, 240, 0.55); }
.stepper li.active { color: #211b32; border-top-color: var(--lilac); }

.field-label { font-size: 12.5px; font-weight: 700; color: #6b6480; margin-bottom: -4px; }
.cast-head em { font-style: normal; font-weight: 600; font-size: 11.5px; color: #8b83a3; margin-left: 4px; }

/* While the photo is being made, say so on the photo itself. */
.preview-card { position: relative; }
.composing {
    position: absolute; inset: 5px;
    border-radius: 16px;
    background: rgba(33, 27, 50, 0.55);
    color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    font-size: 13.5px; font-weight: 700;
    text-align: center;
    padding: 16px;
}

.explainer {
    background: rgba(143, 118, 240, 0.08);
    border: 1px solid rgba(143, 118, 240, 0.25);
    border-radius: 14px;
    padding: 11px 14px;
    display: flex; flex-direction: column; gap: 3px;
    margin-top: 10px;
}
.explainer strong { font-size: 13.5px; font-weight: 800; color: #211b32; }
.explainer strong i { color: var(--lilac); margin-right: 4px; }
.explainer span { font-size: 12.5px; color: #6b6480; line-height: 1.45; }
.step .explainer { margin-top: 0; }
.step .motion-input { margin-top: 0; }

/* Why the video button is greyed out, in plain words. */
.reason {
    font-size: 12.5px; font-weight: 600;
    color: #8a6d2a;
    background: #fff6df;
    border-radius: 10px;
    padding: 8px 12px;
    margin-top: 8px;
}
.step .reason { margin-top: 0; }

/* ---------- The character admiring their own photo wall ---------- */
.wall-companion {
    position: fixed;
    left: 14px; bottom: 22px;
    z-index: 20;
    pointer-events: none;
    filter: drop-shadow(0 6px 8px rgba(15, 8, 0, 0.5));
}
.wall-companion .sprite {
    background-repeat: no-repeat;
    animation-name: sprite-play;
    animation-iteration-count: infinite;
}
@keyframes sprite-play { to { background-position-x: var(--strip-shift); } }
@media (prefers-reduced-motion: reduce) { .wall-companion .sprite { animation: none; } }

/* Crystals: the app's rainbow crystal (oto-app-shell.css span.oto-crystal-gem;
   this page doesn't load the shell stylesheet) */
.oto-crystal-gem {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23D8C5FF'/%3E%3Cstop offset='0.35' stop-color='%23FFE28C'/%3E%3Cstop offset='0.65' stop-color='%23E4E7EC'/%3E%3Cstop offset='1' stop-color='%2388D8FF'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpolygon points='12,22 3,9 7,3 17,3 21,9' fill='url(%23g)' stroke='rgba(255,255,255,0.85)' stroke-width='1.2' stroke-linejoin='round'/%3E%3Cpath d='M3 9h18M7 3l2.6 6L12 22M17 3l-2.6 6L12 22' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='0.9'/%3E%3C/svg%3E") center / contain no-repeat;
    filter: drop-shadow(0 1px 2px rgba(30, 40, 80, 0.9));
}
