:root {
  --paper: #F4EFE6; --paper-2: #EBE4D7; --ink: #0E0E10; --ink-2: #5F5A52; --line: rgba(14,14,16,.12);
  --heart: #D9443A; --navy: #1C2B6E; --yellow: #FFE94D;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; margin: 0; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.lang button { border: 0; background: none; padding: 4px 10px; border-radius: 99px; font-size: 13px; color: var(--ink-2); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.intro { padding: 24px 0 8px; }
.intro h1, .center h1, .thanks h1 { font-size: clamp(34px, 7vw, 56px); line-height: 1.05; }
.sub { color: var(--ink-2); margin: 10px 0 0; max-width: 34em; }
.quiet { color: var(--ink-2); padding: 40px 0; text-align: center; }

.center { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; max-width: 520px; margin: 0 auto; }
.name { display: flex; gap: 10px; width: 100%; margin-top: 22px; }
.name input { flex: 1; min-width: 0; font: 22px var(--serif); padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff8; color: var(--ink); }
.name input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

.primary { border: 0; background: var(--ink); color: var(--paper); padding: 12px 22px; border-radius: 99px; font-weight: 600; }
.primary:active { transform: scale(.98); }
.link { border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: 6px; font-size: 14px; }

.kind { margin-top: 34px; }
.kind h2 { font-size: 15px; font-family: var(--sans); font-weight: 600; text-transform: none; color: var(--ink-2); margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 22px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card .pic { display: block; width: 100%; padding: 0; border: 0; background: var(--paper-2); aspect-ratio: 3 / 4; border-radius: 3px; overflow: hidden; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card .pic:hover img { transform: scale(1.03); }
.card.on .pic { outline: 2px solid var(--heart); outline-offset: 3px; }
.meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.meta .name { font: 17px/1.25 var(--serif); }

.icon { display: inline-flex; width: 22px; height: 22px; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.heart { border: 0; background: none; padding: 6px; margin: -6px; color: var(--ink); flex: none; }
.heart .icon { width: 26px; height: 26px; }
.on > .icon svg, .heart.on svg, .bigheart.on svg, .count.on svg, .mine > .icon svg { fill: var(--heart); stroke: var(--heart); }
.heart.on .icon { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }

.foot { text-align: center; margin: 40px 0 10px; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 5; }
.bar[hidden] { display: none; }
.bar .count { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bar .state { flex: 1; font-size: 13px; color: var(--ink-2); text-align: right; }
.bar .state.bad { color: var(--heart); }

.sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.backdrop { position: absolute; inset: 0; background: rgba(14,14,16,.5); }
.panel { position: relative; background: var(--paper); width: 100%; max-width: 760px; max-height: 94vh; overflow: auto; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: up .25s ease; }
@media (min-width: 720px) { .sheet { align-items: center; } .panel { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper); font-size: 24px; line-height: 1; }
.strip { height: min(100vw, 66vh, 760px); display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--paper-2); }
.strip::-webkit-scrollbar { display: none; }
.strip figure { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: start; position: relative; }
.strip img { width: 100%; height: 100%; object-fit: contain; }
.strip figcaption { position: absolute; left: 12px; bottom: 10px; font-size: 12px; background: var(--paper); padding: 2px 8px; border-radius: 99px; color: var(--ink-2); }
.dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; }
.dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: var(--line); }
.dots button.on { background: var(--ink); }
.body { padding: 14px 20px 24px; display: grid; gap: 14px; }
.body h2 { font-size: 30px; }
.bigheart { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--ink); background: none; border-radius: 99px; padding: 12px; font-weight: 600; }
.bigheart .icon { width: 24px; height: 24px; }
.bigheart.on { border-color: var(--heart); color: var(--heart); }
.body label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.body textarea { font: 16px/1.4 var(--sans); color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff8; resize: vertical; }

.thanks { padding: 24px 0; max-width: 640px; }
.totals { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 10px; }
.totals li { display: grid; grid-template-columns: 52px minmax(0, 1fr) 28px 22px; align-items: center; gap: 12px; }
.totals img { width: 52px; height: 52px; object-fit: cover; border-radius: 3px; background: var(--paper-2); }
.totals .row { display: grid; gap: 4px; }
.totals .name { font: 16px/1.2 var(--serif); }
.track { height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.fill { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.mine .fill { background: var(--heart); }
.totals .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
