:root {
  --bg: #f8f1e7;
  --card: #fffdf9;
  --ink: #2a2420;
  --muted: #6e625a;
  --line: #e6dccf;
  --green: #1f5a43;
  --green-ink: #ffffff;
  --red: #a8322a;
  --gold: #c8962e;
  --reserved-bg: #efe8de;
  --mine-bg: #e6f1ea;
  --focus: #c8962e;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17201c;
    --card: #1f2a25;
    --ink: #f3ece2;
    --muted: #b5aa9e;
    --line: #34413b;
    --green: #6fc39c;
    --green-ink: #10201a;
    --red: #ef8a80;
    --gold: #e2b75a;
    --reserved-bg: #1a2320;
    --mine-bg: #213a2f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 28px 16px 64px; }

header { text-align: center; margin-bottom: 28px; }
.garland { font-size: 28px; letter-spacing: 10px; margin: 0 0 8px; }
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--red);
}
.intro { color: var(--muted); margin: 0 auto; max-width: 30em; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 0 var(--line);
}
.card h2 { font-size: 21px; line-height: 1.3; margin: 0 0 6px; overflow-wrap: anywhere; }
.card .desc { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.card .price { margin: 0 0 14px; color: var(--muted); font-weight: 700; }
.actions { display: grid; gap: 10px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; width: 100%;
  padding: 12px 18px;
  border-radius: 14px;
  border: 2px solid transparent;
  font: inherit; font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--green); color: var(--green-ink); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-quiet { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 700; }
.btn-danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.card.reserved { background: var(--reserved-bg); box-shadow: none; }
.card.reserved h2, .card.reserved .desc { color: var(--muted); }
.card.mine { background: var(--mine-bg); border-color: var(--green); }
.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 16px; font-weight: 800;
  background: var(--line); color: var(--muted);
}
.card.mine .badge { background: var(--green); color: var(--green-ink); }

.confirm { display: grid; gap: 10px; padding-top: 4px; }
label { font-weight: 700; }
.hint { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--green); outline: none; }

.empty, .loading { text-align: center; color: var(--muted); padding: 40px 0; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: 20px;
  max-width: 560px; margin: 0 auto;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--ink); color: var(--bg);
  font-weight: 700; text-align: center;
  transform: translateY(calc(100% + 40px)); visibility: hidden;
  transition: transform .25s ease, visibility .25s;
}
.toast.show { transform: none; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

footer { text-align: center; color: var(--muted); font-size: 15px; margin-top: 36px; }

/* Admin */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 22px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.note { background: var(--reserved-bg); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: 16px; margin: 0 0 20px; }
.row-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-tools .wide { grid-column: 1 / -1; }
.error-msg { color: var(--red); font-weight: 700; margin: 0 0 10px; }
.reveal-list { margin: 12px 0 0; padding-left: 20px; }

a { color: var(--green); font-weight: 700; }

/* Images */
.card-img {
  display: block;
  width: calc(100% + 40px);
  margin: -20px -20px 16px;
  height: 220px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--line);
}
.card.reserved .card-img { opacity: .45; filter: grayscale(1); height: 140px; }
.card.mine .card-img, .card.reserved .card-img { margin-top: 0; border-radius: 12px; width: 100%; margin-left: 0; margin-right: 0; border: 1px solid var(--line); }
.thumb { display: block; width: 100%; max-height: 240px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.thumb[hidden] { display: none; }
.photo-msg:empty { display: none; }
.photo-msg { margin: 0; }
.label { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.btn { font-weight: 800; }

[hidden] { display: none !important; }
