.center { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 24px 16px; }

/* cover */
.cover { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.cover .panel { width: min(420px, 100%); text-align: center; }
.cover h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.1; margin-bottom: 8px; }
.cover .count { color: var(--muted); margin-bottom: 28px; }
.cover .message { white-space: pre-line; margin: 0 auto 24px; max-width: 36em; color: var(--muted); }
.cover form { text-align: left; }
.cover .btn.primary { width: 100%; min-height: 48px; font-size: 16px; }
.cover .brand { margin-top: 36px; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

/* header */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.bar .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.bar h1 { font-size: 20px; margin: 0; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally { font-size: 14px; color: var(--muted); white-space: nowrap; }
.tally strong { color: var(--text); }
.tally.over strong { color: var(--warn); }
.sections { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 12px; scrollbar-width: none; }
.sections::-webkit-scrollbar { display: none; }
.sections button { flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px;
  font-size: 13px; cursor: pointer; color: var(--muted); }
.sections button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.intro { margin: 18px 0 4px; color: var(--muted); white-space: pre-line; max-width: 46em; }

/* grid: rows whose photos keep their shape */
.section-title { font-size: 22px; margin: 28px 0 10px; }
.rows { display: flex; flex-wrap: wrap; gap: 6px; }
.rows::after { content: ""; flex-grow: 1000000; }
.ph { position: relative; flex-grow: var(--r); flex-basis: calc(var(--r) * 210px); aspect-ratio: var(--r); background: var(--surface-2);
  border-radius: 4px; overflow: hidden; cursor: zoom-in; }
@media (max-width: 600px) { .ph { flex-basis: calc(var(--r) * 130px); } }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .3s; opacity: 0; }
.ph img.loaded { opacity: 1; }
.ph .play { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 999px;
  padding: 3px 9px 3px 7px; font-size: 12px; display: flex; gap: 4px; align-items: center; }
.heart { position: absolute; right: 8px; top: 8px; width: 38px; height: 38px; border-radius: 999px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(0, 0, 0, .35); color: #fff; opacity: 0; transition: opacity .15s, transform .1s; }
.heart svg { width: 20px; height: 20px; }
.ph:hover .heart, .ph:focus-within .heart, .heart.on, .touch .heart { opacity: 1; }
.heart.on { background: #fff; color: var(--heart); }
.heart:active { transform: scale(.9); }
.heart[disabled] { cursor: default; }
.note-dot { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 60; background: #0b0b0a; color: #f0ede6; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lb header, .lb footer { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.lb header .name { flex: 1; font-size: 13px; color: #a39e94; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .stage { position: relative; min-height: 0; overflow: hidden; }
.lb .stage img, .lb .stage video { position: absolute; top: 0; bottom: 0; left: 56px; right: 56px; width: calc(100% - 112px); height: 100%;
  object-fit: contain; user-select: none; -webkit-user-drag: none; }
@media (max-width: 600px) { .lb .stage img, .lb .stage video { left: 0; right: 0; width: 100%; } }
.lb .nav { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; background: transparent;
  color: #f0ede6; cursor: pointer; font-size: 30px; opacity: .7; }
.lb .nav:hover { opacity: 1; }
.lb .prev { left: 6px; } .lb .next { right: 6px; }
.lb .btn { background: transparent; color: #f0ede6; border-color: #3a3833; }
.lb .btn.on { background: #fff; color: var(--heart); border-color: #fff; }
.lb footer { flex-wrap: wrap; justify-content: center; }
.lb textarea { flex: 1 1 280px; min-height: 40px; max-height: 120px; background: #1c1b19; color: #f0ede6; border: 1px solid #3a3833;
  border-radius: 8px; padding: 9px 12px; resize: vertical; }

/* footer action */
.dock { position: sticky; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 10px; align-items: center; flex-wrap: wrap; }
.sent { text-align: center; }
