/* ---------- The doodle locket (js/locket.js) ---------- */
.locketbox { display: grid; justify-items: center; gap: 10px; width: min(560px, calc(100% - 32px)); margin: var(--space-5) auto 0; }
.locket { position: relative; display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.locket__chain { width: 2px; height: 34px; margin-bottom: -10px; background: repeating-linear-gradient(#E8B64C 0 4px, #FFF0B8 4px 6px, transparent 6px 8px); }
.locket__svg { width: 128px; height: auto; overflow: visible; transform-origin: 50% 0; filter: drop-shadow(0 10px 14px rgba(150, 95, 20, 0.35)); animation: locket-swing 5s ease-in-out infinite; }
@keyframes locket-swing { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.locket.has-new .locket__svg { animation: locket-wiggle 1.6s ease-in-out infinite; }
@keyframes locket-wiggle { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(-9deg); } 76% { transform: rotate(8deg); } 84% { transform: rotate(-5deg); } 92% { transform: rotate(3deg); } }
.locket__engrave { font: 700 12px var(--font-hand); fill: #9C6A1A; letter-spacing: 0.5px; }
.locket__new { position: absolute; top: 40px; right: -18px; padding: 3px 9px; border-radius: 999px; background: var(--rose); color: #FFFFFF; font: 800 0.72rem var(--font-body); opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.locket.has-new .locket__new { opacity: 1; transform: scale(1); }
.locket__label { display: grid; justify-items: center; }
.locket__label b { font-family: var(--font-hand); font-size: 1.35rem; color: #B2507A; }
.locket__label small { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.locket__draw { min-height: 40px; padding: 0 18px; border: 2px solid #F1C25B; border-radius: 999px; background: linear-gradient(#FFF6D6, #FFE7A0); color: #8A5A10; font: 800 0.9rem var(--font-body); cursor: pointer; box-shadow: 0 6px 14px -8px rgba(150, 95, 20, 0.6); -webkit-tap-highlight-color: transparent; }
.locket__draw:active { transform: scale(0.96); }
.locket__top { display: grid; justify-items: center; }
.stackview__base .locket__label b, .stackview__base .locket__label small { color: #FFFFFF; }
.stackview__base .locket__new { display: none; }
@media (prefers-reduced-motion: reduce) { .locket__svg, .locket.has-new .locket__svg { animation: none; } }

/* a doodle card in the stack */
.doodle-card { display: grid; gap: 6px; padding: 10px 10px 6px; border-radius: 18px; background: #FFFFFF; border: 3px solid; }
.doodle-card--hawwi { border-color: #FFB3CF; }
.doodle-card--za { border-color: #A9D2FF; }
.doodle-card__img { width: 100%; aspect-ratio: 1; border-radius: 12px; background: #FFFBF5; display: block; }
.doodle-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doodle-card__by { font-size: 0.8rem; font-weight: 800; color: var(--muted); }

/* the drawing pad */
.pad { width: min(460px, calc(100% - 16px)); max-height: calc(100dvh - 16px); padding: 0; border: 0; background: none; overflow: visible; }
.pad::backdrop { background: rgba(40, 10, 25, 0.6); }
.pad__card { display: grid; gap: 10px; padding: 14px; border-radius: 24px; background: linear-gradient(180deg, #FFF8EC, #FFEFD6); box-shadow: 0 24px 48px -16px rgba(74, 23, 52, 0.6); }
.pad__head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-hand); font-size: 1.35rem; color: #8A5A10; }
.pad__x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #FFFFFF; color: var(--rose); font-size: 1.3rem; font-weight: 800; line-height: 1; cursor: pointer; }
.pad__stage { position: relative; width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 3px #F1C25B, 0 8px 18px -12px rgba(150, 95, 20, 0.7); }
.pad__canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.pad__guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pad__tools { display: grid; gap: 8px; }
.pad__swatches, .pad__sizes { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 7px; }
.pad__swatch { width: 30px; height: 30px; border: 3px solid #FFFFFF; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); cursor: pointer; }
.pad__swatch.is-on { box-shadow: 0 0 0 3px var(--rose); transform: scale(1.12); }
.pad__size { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid #FFFFFF; border-radius: 50%; background: rgba(255, 255, 255, 0.8); cursor: pointer; }
.pad__size::after { content: ''; width: var(--s); height: var(--s); border-radius: 50%; background: #4A1734; }
.pad__size.is-on, .pad__tool.is-on { border-color: var(--rose); background: #FFE3EE; }
.pad__tool { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 2px solid #FFFFFF; border-radius: 50%; background: rgba(255, 255, 255, 0.8); color: #4A1734; font-size: 1.05rem; cursor: pointer; }
.pad__icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
html[data-dark] .pad__tool { background: rgba(255, 255, 255, 0.85); color: #4A1734; border-color: #FFFFFF; }
html[data-dark] .pad__tool.is-on { background: #FFE3EE; border-color: var(--rose); }
.pad__send { min-height: 48px; border: 0; border-radius: 999px; background: linear-gradient(#F5C764, #E0A53A); color: #FFFFFF; font: 800 1rem var(--font-body); text-shadow: 0 1px 2px rgba(120, 70, 0, 0.5); box-shadow: 0 8px 18px -10px rgba(150, 95, 20, 0.9); cursor: pointer; }
.pad__send:disabled { opacity: 0.6; }
.pad__msg { min-height: 1em; margin: 0; text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--muted); }

/* ---------- The keepsakes: notes jar + doodle locket side by side, suggestion box underneath ---------- */
.keepsakes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; column-gap: var(--space-3); width: min(640px, calc(100% - 24px)); margin: var(--space-4) auto 0; }
.keepsakes > .jarbox, .keepsakes > .locketbox { width: 100%; margin: 0; align-self: end; }
.keepsakes > .ideas { grid-column: 1 / -1; width: min(560px, 100%); justify-self: center; }
.keepsakes .locket__label, .keepsakes .glassjar__label { text-align: center; }
/* very narrow phones: one column again */
@media (max-width: 340px) { .keepsakes { grid-template-columns: 1fr; } }

/* ---------- Love coupons (js/coupons.js) ---------- */
.keepsakes > .couponbox { grid-column: 1 / -1; justify-self: center; display: grid; justify-items: center; gap: 10px; margin-top: var(--space-5); }
.booklet { position: relative; display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.booklet__pages { position: relative; display: block; width: 150px; height: 92px; }
.booklet__pages i { position: absolute; inset: 0; border-radius: 12px; background: #FFE7A0; border: 2px dashed rgba(201, 143, 42, 0.55); box-shadow: 0 10px 18px -12px rgba(150, 95, 20, 0.7); }
.booklet__pages i:nth-child(1) { transform: rotate(-8deg) translate(-8px, 6px); background: #C9E7FF; border-color: rgba(47, 123, 217, 0.4); }
.booklet__pages i:nth-child(2) { transform: rotate(6deg) translate(8px, 4px); background: #FFC8DD; border-color: rgba(190, 24, 93, 0.35); }
.booklet__pages i:nth-child(3) { display: grid; place-items: center; background: repeating-linear-gradient(-45deg, #FFF3C9 0 10px, #FFEBAF 10px 20px); text-align: center; }
.booklet__pages b { font: 800 0.95rem/1.05 var(--font-display); letter-spacing: 1px; color: #9C6A1A; }
.booklet__pages em { position: absolute; right: 10px; bottom: 4px; font-style: normal; color: var(--rose); font-size: 1.1rem; }
.booklet:active .booklet__pages { transform: scale(0.96); }
.booklet.has-new .booklet__pages { animation: locket-wiggle 1.8s ease-in-out infinite; }
.booklet__new { position: absolute; top: -8px; right: -16px; padding: 3px 9px; border-radius: 999px; background: var(--rose); color: #FFFFFF; font: 800 0.72rem var(--font-body); }
.booklet__new:empty { display: none; }
.booklet__label { display: grid; justify-items: center; }
.booklet__label b { font-family: var(--font-hand); font-size: 1.35rem; color: #B2507A; }
.booklet__label small { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.booklet__make { min-height: 40px; padding: 0 18px; border: 2px solid #F1C25B; border-radius: 999px; background: linear-gradient(#FFF6D6, #FFE7A0); color: #8A5A10; font: 800 0.9rem var(--font-body); cursor: pointer; box-shadow: 0 6px 14px -8px rgba(150, 95, 20, 0.6); }
.stackview__base .booklet__label b, .stackview__base .booklet__label small { color: #FFFFFF; }
.stackview__base .booklet__new { display: none; }
.coupon-top { display: grid; justify-items: center; gap: 8px; }
.coupon-tabs { display: flex; gap: 6px; }
.coupon-tabs .chip-btn { min-height: 34px; font-size: 0.8rem; }
.coupon-empty { color: #FFFFFF; text-align: center; font-weight: 700; }

/* a coupon: stub | main | action, with a dotted tear line */
.coupon { display: grid; grid-template-columns: 62px 1fr auto; align-items: stretch; min-height: 104px; border-radius: 16px; overflow: hidden; background: #FFF6D6; color: #4A1734; box-shadow: 0 10px 20px -14px rgba(74, 23, 52, 0.6); }
.coupon--hawwi { background: #FFE6EF; }
.coupon--za { background: #E3F0FF; }
.coupon__stub { display: grid; place-items: center; border-right: 3px dashed rgba(74, 23, 52, 0.22); background: rgba(255, 255, 255, 0.45); }
.coupon__emoji { font-size: 2rem; }
.coupon__main { display: grid; align-content: center; gap: 2px; padding: 10px 12px; min-width: 0; }
.coupon__kicker { margin: 0; font: 800 0.62rem var(--font-body); letter-spacing: 1px; text-transform: uppercase; color: #9C6A80; }
.coupon__title { margin: 0; font: 700 1.15rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.coupon__note { margin: 0; font-size: 0.78rem; font-style: italic; color: #7D4565; }
.coupon__by { margin: 2px 0 0; font-size: 0.7rem; font-weight: 700; color: #9C6A80; }
.coupon__act { display: grid; place-items: center; gap: 4px; padding: 8px 10px 8px 0; }
.coupon__use { min-height: 38px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--rose); color: #FFFFFF; font: 800 0.82rem var(--font-body); white-space: nowrap; cursor: pointer; box-shadow: 0 6px 12px -6px rgba(190, 24, 93, 0.7); }
.coupon__wait { font-size: 0.7rem; font-weight: 800; color: #9C6A80; white-space: nowrap; }
.coupon__stamp { padding: 4px 8px; border: 2px solid #4CB860; border-radius: 8px; color: #2E8A44; font: 800 0.7rem var(--font-body); transform: rotate(-8deg); white-space: nowrap; }
.coupon.is-used { opacity: 0.7; }
.coupon.is-used .coupon__title { text-decoration: line-through; text-decoration-color: rgba(74, 23, 52, 0.35); }

/* the maker */
.couponmake { width: min(460px, calc(100% - 16px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; background: none; overflow: visible; }
.couponmake::backdrop { background: rgba(40, 10, 25, 0.5); }
.couponmake__card { display: grid; gap: 10px; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 16px; border-radius: 24px; background: var(--bg); color: var(--text); box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.5); }
.couponmake__head { display: flex; align-items: center; justify-content: space-between; }
.couponmake__head b { font-family: var(--font-hand); font-size: 1.5rem; color: var(--rose); }
.couponmake__x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--blush); color: var(--rose); font-size: 1.3rem; font-weight: 800; line-height: 1; cursor: pointer; }
.couponmake__label { margin: 4px 0 0; font-size: 0.82rem; font-weight: 800; color: var(--muted); }
.couponmake__emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.couponmake__emoji { width: 40px; height: 40px; border: 2px solid transparent; border-radius: 12px; background: rgba(255, 255, 255, 0.8); font-size: 1.3rem; cursor: pointer; }
.couponmake__emoji[aria-pressed="true"] { border-color: var(--rose); background: var(--blush); }
.couponmake__input { width: 100%; min-height: 44px; padding: 0 14px; border: 2px solid var(--blush); border-radius: 14px; background: #FFFFFF; color: #4A1734; font: 700 1rem var(--font-body); box-sizing: border-box; }
.couponmake__input--small { min-height: 38px; font-size: 0.88rem; font-weight: 600; }
.couponmake__ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.couponmake__ideas .chip-btn { min-height: 32px; font-size: 0.76rem; }
.couponmake__send { justify-self: center; min-height: 48px; }
.couponmake__msg { margin: 0; min-height: 1em; text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
html[data-dark] .couponmake__emoji { background: var(--card-solid); }
