:root {
  color-scheme: light;
  --bg: #f8f6ef;
  --card: #fffdf8;
  --ink: #203d33;
  --muted: #69766b;
  --gold: #b69755;
  --line: #dcd6c5;
  --hero: #183d32;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
}
body.dark {
  color-scheme: dark;
  --bg: #10231d;
  --card: #19342a;
  --ink: #f1eddf;
  --muted: #b2bcae;
  --line: #395044;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 4px;
  padding: 12px 18px;
  min-height: 44px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
header {
  text-align: center;
  background: var(--hero);
  color: #f5efdf;
  padding: 42px 20px 30px;
  position: relative;
}
.eyebrow {
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: #d1b97c;
}
h1 {
  font-family: Georgia, serif;
  font-size: 50px;
  font-weight: 400;
  letter-spacing: 8px;
  margin: 16px 0 8px;
}
h1 span {
  font-size: 30px;
  color: #d1b97c;
}
header p {
  font-size: 12px;
  line-height: 2;
  color: #d2d9ca;
}
h2 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 2px;
}
.ornament {
  color: #c5aa6e;
  margin: 23px 0;
}
button.gold {
  display: block;
  background: #ccb578;
  color: #16382c;
  border: 0;
  border-radius: 40px;
  width: 210px;
  margin: 26px auto 5px;
  font-size: 22px;
  letter-spacing: 6px;
  box-shadow: 0 5px 18px #0002;
}
.textbutton {
  display: block;
  border: 0;
  background: transparent;
  color: #e2d5b5;
  margin: auto;
  font-size: 12px;
  text-decoration: underline;
}
.theme {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: 0;
  color: #dfcfaa;
  font-size: 22px;
}
main {
  max-width: 700px;
  margin: auto;
  padding: 10px 18px 40px;
}
nav {
  display: flex;
  margin: 12px 0 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}
nav button {
  width: 50%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 18px 2px;
}
nav button[aria-selected="true"] {
  color: var(--ink);
  border-bottom: 2px solid var(--gold);
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.photo {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.photo .open {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--line);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.like {
  border: 0;
  background: transparent;
  display: block;
  margin-left: auto;
  font-size: 15px;
  padding: 8px 12px;
}
.like[aria-pressed="true"] {
  color: #b24c50;
}
.rank .photo:first-child {
  grid-column: 1/-1;
}
.rank .photo:first-child .open {
  aspect-ratio: 4/3;
}
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #183d32e8;
  color: #e5cf8f;
  padding: 5px 12px;
  border-radius: 2px;
  font-family: Georgia, serif;
  font-size: 18px;
  pointer-events: none;
}
#more {
  display: block;
  margin: 25px auto;
}
#empty,
#gate {
  text-align: center;
  padding: 30px 0;
  font-size: 14px;
}
input {
  padding: 12px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
}
footer {
  text-align: center;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 12px;
  padding: 20px 0 40px;
}
dialog {
  border: 0;
  background: var(--bg);
  color: var(--ink);
  padding: 12px;
  max-width: 96vw;
  max-height: 95dvh;
  border-radius: 6px;
}
dialog::backdrop {
  background: #000d;
}
#full {
  display: block;
  max-width: 88vw;
  max-height: 75dvh;
  object-fit: contain;
  min-width: 200px;
  min-height: 120px;
}
#close {
  display: block;
  margin: 0 0 8px auto;
  font-size: 22px;
}
#fullLike {
  display: block;
  margin: 10px auto 0;
}
#toast {
  position: fixed;
  bottom: calc(25px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #183d32;
  color: #fff;
  padding: 14px 20px;
  border: 1px solid #b69755;
  border-radius: 6px;
  z-index: 10;
  max-width: 92vw;
  width: max-content;
  display: none;
  font-size: 13px;
}
progress {
  width: 210px;
  accent-color: var(--gold);
}
[hidden] {
  display: none !important;
}
.adminbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px;
  font-size: 12px;
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      opacity 0.15s,
      background 0.15s;
  }
}
@media (min-width: 700px) {
  header {
    padding-top: 50px;
  }
  .grid {
    gap: 22px;
  }
}
/* Wedding stationery: fine botanical illustration, warm paper and quiet gold. */
:root {
  --bg: #faf7f0;
  --card: #fffefa;
  --line: #e7dfcd;
  --gold: #b6995e;
}
body {
  background-image: radial-gradient(#b49c6810 0.6px, transparent 0.6px);
  background-size: 5px 5px;
}
header {
  isolation: isolate;
  overflow: hidden;
  padding: 52px 24px 35px;
  background: radial-gradient(
    ellipse at 50% 5%,
    #2c5142 0,
    #183d32 60%,
    #15362c 100%
  );
  border-bottom: 4px double #b79b5c75;
  box-shadow: 0 8px 35px #17392c0a;
}
header:before,
header:after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4px;
  left: -19px;
  width: 175px;
  height: 265px;
  background: url("/assets/botanical.svg") center/contain no-repeat;
  opacity: 0.65;
  pointer-events: none;
}
header:after {
  left: auto;
  right: -20px;
  top: 145px;
  transform: rotate(180deg);
  opacity: 0.45;
}
.hero-frame {
  position: absolute;
  z-index: -1;
  inset: 16px 14px;
  border: 1px solid #c6ac6d38;
  border-radius: 150px 150px 8px 8px;
  pointer-events: none;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 3.5px;
  margin-top: 5px;
}
h1 {
  font-size: 60px;
  line-height: 1.1;
  letter-spacing: 6px;
  margin: 21px 0 14px;
  text-shadow: 0 2px 12px #0001;
}
h1 span {
  font-style: italic;
  font-size: 35px;
  font-weight: 400;
  color: #d6c08a;
}
header > p:first-of-type {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #d7dfd0;
}
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 9px auto 0;
}
.ornament img {
  width: 65px;
  height: 52px;
}
.ornament span {
  width: 45px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ccb77d);
}
.ornament span:last-child {
  transform: rotate(180deg);
}
.story-label {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: #d7c28e;
  letter-spacing: 0.5px;
  margin: 0 0 16px;
}
header h2 {
  font-size: 21px;
  letter-spacing: 2px;
  margin: 0 0 15px;
}
header h2 + p {
  font-size: 11px;
  line-height: 2.2;
  letter-spacing: 1.1px;
  margin: 0;
  color: #d7dfd3;
}
button.gold {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 218px;
  min-height: 62px;
  margin: 25px auto 7px;
  border: 1px solid #ead9a5;
  background: linear-gradient(130deg, #e5d3a3, #c7ad70);
  border-radius: 40px;
  box-shadow:
    0 5px 20px #051b1530,
    inset 0 0 0 4px #f9eccb32;
  font-size: 22px;
  letter-spacing: 5px;
}
button.gold svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: #294638;
  stroke-width: 1.3;
  stroke-linejoin: round;
}
button.gold:hover {
  filter: brightness(1.06);
}
.textbutton {
  font-size: 11px;
  letter-spacing: 1px;
  text-underline-offset: 5px;
  color: #d9ceaf;
}
.theme {
  color: #e1d3ad;
  right: 20px;
  top: 21px;
  font-size: 20px;
}
main {
  padding: 10px 17px 40px;
  max-width: 720px;
}
nav {
  margin: 12px 0 26px;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 12px var(--bg);
}
nav button {
  padding: 17px 0 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  font-size: 12px;
}
nav button small {
  display: block;
  font-family: Georgia, serif;
  letter-spacing: 1.6px;
  font-weight: 400;
  font-size: 8px;
  margin-bottom: 8px;
  color: var(--muted);
}
nav button[aria-selected="true"] {
  border-bottom-color: var(--gold);
}
nav button[aria-selected="true"] small {
  color: var(--gold);
}
.grid {
  gap: 17px 13px;
}
.photo {
  border: 1px solid var(--line);
  padding: 6px 6px 0;
  border-radius: 7px;
  box-shadow: 0 3px 12px #382b1207;
}
.photo .open {
  border-radius: 3px;
}
.photo .like {
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 17px;
  min-height: 42px;
  padding: 8px 6px;
  letter-spacing: 2px;
}
.like[aria-pressed="true"] {
  color: #b16b77;
}
.rank .photo:first-child {
  padding: 9px 9px 0;
  box-shadow: 0 5px 25px #b6975518;
  border-color: #cdb780;
}
.rank .photo:first-child .open {
  aspect-ratio: 4/3;
}
.badge {
  top: 6px;
  left: 14px;
  padding: 10px 10px 17px;
  min-width: 34px;
  text-align: center;
  font-style: italic;
  background: #234638;
  color: #ebd9a6;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 83%, 0 100%);
  font-size: 19px;
}
.rank .photo:first-child .badge {
  top: 9px;
  left: 20px;
  background: #b4985d;
  color: #fffbee;
  font-size: 26px;
  padding: 13px 13px 22px;
}
#more {
  font-size: 12px;
  padding: 12px 32px;
  border-radius: 30px;
  letter-spacing: 2px;
  background: transparent;
}
#empty {
  font-size: 13px;
  line-height: 2;
  letter-spacing: 1px;
  padding: 45px 10px;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  padding: 15px 0 35px;
}
footer img {
  width: 56px;
  height: 44px;
  opacity: 0.8;
}
footer p {
  font-size: 19px;
  font-style: italic;
  color: var(--gold);
  margin: 2px 0 10px;
}
footer span {
  font-size: 10px;
  letter-spacing: 0.6px;
}
dialog {
  padding: 16px;
  border: 1px solid #c7b07b;
  border-radius: 12px;
  box-shadow: 0 20px 80px #0005;
}
#close {
  border: 0;
  background: transparent;
  min-width: 44px;
  border-radius: 50%;
}
#full {
  border-radius: 4px;
}
#fullLike {
  border-radius: 24px;
  min-width: 100px;
  color: #b16b77;
  font-family: Georgia, serif;
  font-size: 20px;
  letter-spacing: 2px;
}
#toast {
  border-radius: 30px;
  box-shadow: 0 8px 35px #0002;
  line-height: 1.8;
}
body.dark {
  --bg: #14271f;
  --card: #1c352b;
  --ink: #f2eee1;
  --muted: #b1b9ab;
  --line: #364d3e;
}
body.dark .photo {
  box-shadow: 0 3px 15px #0002;
}
#queueDetails {
  max-width: 310px;
  margin: 16px auto 0;
  text-align: left;
  color: #ddd4ba;
  font-size: 11px;
}
#queueDetails summary {
  cursor: pointer;
  text-align: center;
  min-height: 35px;
}
#queueList > div {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 5px 0;
}
#queueList button {
  font-size: 10px;
  min-height: 36px;
  padding: 6px 8px;
}
#queueStatus {
  margin: 5px 0 0;
  font-size: 10px;
}
@media (min-width: 700px) {
  header {
    padding: 55px 24px 36px;
  }
  .hero-frame {
    inset: 20px calc(50% - 310px);
    border-radius: 220px 220px 8px 8px;
  }
  header:before {
    left: calc(50% - 310px);
    width: 210px;
  }
  header:after {
    right: calc(50% - 310px);
    width: 210px;
  }
  main {
    padding: 15px 24px 45px;
  }
  nav button {
    font-size: 14px;
  }
  .grid {
    gap: 22px;
  }
  nav button small {
    font-size: 9px;
  }
}
@media (max-width: 350px) {
  h1 {
    font-size: 50px;
  }
  header h2 {
    font-size: 18px;
  }
  nav {
    gap: 7px;
  }
  nav button {
    font-size: 11px;
  }
  .grid {
    gap: 10px;
  }
  header:before {
    opacity: 0.4;
  }
}
#composer {
  width: min(440px, 94vw);
  padding: 25px 18px 18px;
}
.compose-heading {
  text-align: center;
}
.compose-heading .story-label {
  font-size: 15px;
  color: var(--gold);
}
.compose-heading h2 {
  font-size: 17px;
  letter-spacing: 1px;
  margin: 12px 0;
}
.compose-heading p,
.compose-note {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
}
#composePhotos {
  max-height: 49dvh;
  overflow: auto;
  display: grid;
  gap: 12px;
  margin: 18px 0;
}
.draft-photo {
  border: 1px solid var(--line);
  padding: 7px;
  border-radius: 7px;
  cursor: pointer;
  background: var(--card);
  font-size: 12px;
}
.draft-photo img {
  display: block;
  width: 100%;
  max-height: 37dvh;
  object-fit: contain;
  background: var(--bg);
  border-radius: 3px;
  margin-bottom: 10px;
}
.draft-photo input {
  accent-color: #244c39;
  margin: 0 8px 5px 5px;
}
.draft-photo.unselected img {
  opacity: 0.35;
}
.compose-send {
  display: block;
  background: #214735;
  color: #f3e9ce;
  border: 1px solid #b79b5c;
  width: 100%;
  border-radius: 30px;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 14px;
}
.compose-cancel {
  display: block;
  margin: 8px auto 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
body.dark .compose-send {
  background: #cdb77d;
  color: #173c2c;
}
.save-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 5px;
}
.save-actions #savePhoto {
  border: 1px solid #c6ad71;
  background: #214735;
  color: #f5ebd0;
  border-radius: 30px;
  padding: 12px 24px;
  font-size: 14px;
  letter-spacing: 1px;
}
.save-actions #downloadPhoto {
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 12px;
  color: var(--muted);
}
.save-note {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  margin: 10px 0 3px;
}
body.dark .save-actions #savePhoto {
  background: #ccb77e;
  color: #193c2c;
}

#login ~ #grid .photo > img { width:100%; height:auto; aspect-ratio:1; object-fit:cover; }
