:root {
  --stamp: #b0492c;
  --bg: #f3ebd9;
  --paper: #fdf8ec;
  --ink: #3b3325;
  --line: #d9cbae;
  --field: #f6efdd;
  --soft: #6f6146;
  --muted: #8d7d60;
  --faint: #a4967a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

.page { min-height: 100vh; padding: 26px 16px 90px; }
.wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.hand { font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; }
h1, h2, h3 { margin: 0; font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; }
h1 { font-size: 42px; line-height: 1.1; }
h2 { font-size: 24px; }
a { color: inherit; }

input::placeholder, textarea::placeholder { color: var(--faint); }

/* ------- language picker ------- */
.lang-row { display: flex; justify-content: center; }
.lang-pill {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 7px 18px; font-size: 14px;
}
.lang-pill .lang {
  color: var(--muted); text-decoration: none;
  font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700;
}
.lang-pill a.lang:hover { color: var(--ink); }
.lang-pill .lang.active { color: var(--stamp); }
.lang-pill .sep { color: var(--line); }

/* ------- hero ------- */
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-top: 6px; }
.hero .logo {
  width: 56px; height: 56px; border: 3px solid var(--stamp); border-radius: 16px;
  transform: rotate(-7deg); display: grid; place-items: center; color: var(--stamp);
  font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; font-size: 21px;
}
.hero p { margin: 0; max-width: 420px; color: var(--soft); text-wrap: pretty; }

/* ------- cards ------- */
.card {
  background: var(--paper); border: 2px solid var(--ink);
  border-radius: 22px 18px 24px 20px; padding: 18px;
  box-shadow: 4px 5px 0 rgba(59, 51, 37, 0.12);
}
.card--map { border-radius: 18px 24px 20px 26px; padding: 14px 14px 12px; transform: rotate(-0.3deg); }
.card--rock {
  border-radius: 22px 18px 26px 20px; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.card--form { border-radius: 20px 24px 18px 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }

/* ------- map ------- */
.map-holder { position: relative; }
.map-holder canvas { width: 100%; height: auto; display: block; border-radius: 12px; }
.map-total { display: flex; justify-content: center; padding-top: 10px; font-size: 12.5px; color: var(--muted); }
@keyframes pinDrop { from { transform: translate(-50%, -140%); opacity: 0; } to { transform: translate(-50%, -100%); opacity: 1; } }
.map-pin {
  position: absolute; transform: translate(-50%, -100%); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; animation: pinDrop 0.4s ease both;
}
.map-pin .tag {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--ink); color: var(--paper); border-radius: 10px; padding: 4px 11px; white-space: nowrap;
}
.map-pin .tag .label { font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; font-size: 13px; line-height: 1.2; }
.map-pin .tag .sub { font-size: 10px; opacity: 0.75; line-height: 1.2; }
.map-pin .stem { width: 2px; height: 9px; background: var(--ink); }
.map-pin .dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--stamp);
  border: 2.5px solid var(--paper); box-shadow: 0 1px 0 rgba(59, 51, 37, 0.35);
}

/* ------- trips / rock grid ------- */
.section { display: flex; flex-direction: column; gap: 12px; }
.trip-card { display: flex; flex-direction: column; gap: 14px; }
.trip-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.trip-head .name { font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; font-size: 26px; }
.trip-head .sub { font-size: 13px; color: var(--muted); }
.rock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .rock-grid { grid-template-columns: 1fr; } }
.rock-btn {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--field); border: 1.5px solid var(--line);
  border-radius: 14px 18px 14px 16px; padding: 12px 14px; cursor: pointer;
  font-family: inherit; color: inherit; font-size: inherit; text-decoration: none;
}
.rock-btn:hover { border-color: var(--ink); transform: translate(-1px, -1px); box-shadow: 2px 3px 0 rgba(59, 51, 37, 0.15); }
.rock-btn .info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rock-btn .info .name { font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; font-size: 17px; }
.rock-btn .info .meta { font-size: 12px; color: var(--muted); }
.footnote { margin: 0; text-align: center; font-size: 13px; color: var(--faint); }

/* ------- rock blobs ------- */
.blob {
  border-radius: 48% 52% 55% 45% / 55% 48% 52% 45%;
  display: grid; place-items: center; color: var(--paper);
  font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; transform: rotate(-4deg);
}
.blob--sm { width: 46px; height: 38px; flex-shrink: 0; font-size: 19px; box-shadow: 2px 2px 0 rgba(59, 51, 37, 0.2); }
.blob--lg { width: 118px; height: 94px; font-size: 42px; box-shadow: 3px 4px 0 rgba(59, 51, 37, 0.22); }
img.blob { object-fit: cover; display: block; border: 2px solid var(--ink); }
img.blob--lg { width: 168px; height: 134px; }
.photo-form label { display: inline-block; }

/* ------- rock page ------- */
.back-row { display: flex; }
.back-link {
  background: none; border: none; cursor: pointer; text-decoration: none;
  font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; font-size: 15px;
  color: var(--soft); padding: 4px 6px 4px 0;
}
.back-link:hover { color: var(--ink); }
.rock-title { font-size: 34px; line-height: 1.1; }
.rock-spot { margin: 0; color: var(--soft); }
.rock-hint { margin: 0; font-size: 13px; color: var(--faint); font-style: italic; }

.banner-sign {
  background: color-mix(in oklab, var(--stamp) 10%, var(--paper));
  border: 2px solid var(--stamp); border-radius: 16px 20px 16px 22px;
  padding: 14px 18px; transform: rotate(0.3deg);
}
.banner-sign .lead { font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; color: var(--stamp); }
.banner-sign .rest { color: var(--soft); }
.banner-read {
  background: #efe6d0; border: 1.5px dashed #b9a87f; border-radius: 16px 20px 16px 22px;
  padding: 14px 18px; color: var(--soft);
}
.banner-wait {
  border: 1.5px dashed var(--stamp); border-radius: 16px 20px 16px 22px;
  padding: 14px 18px; color: var(--soft); background: var(--paper);
}

/* ------- guestbook entries ------- */
.entries { display: flex; flex-direction: column; gap: 12px; }
@keyframes stampPop {
  0% { transform: scale(1.7) rotate(-10deg); opacity: 0; }
  60% { transform: scale(0.94) rotate(-2deg); opacity: 1; }
  100% { transform: scale(1) rotate(-1deg); opacity: 1; }
}
.entry {
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 14px 18px 14px 20px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.entry:nth-child(odd) { transform: rotate(-0.5deg); }
.entry:nth-child(even) { transform: rotate(0.6deg); }
.entry.fresh { animation: stampPop 0.45s ease both; }
.entry .msg { margin: 0; font-size: 15.5px; overflow-wrap: anywhere; }
.entry .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry .stampchip {
  display: inline-flex; border: 2px solid var(--stamp); color: var(--stamp);
  border-radius: 7px; padding: 1px 9px; font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive;
  font-weight: 700; font-size: 13px; transform: rotate(-2deg);
}
.entry .from { font-size: 13px; color: var(--muted); }
.entry .date { font-size: 12px; color: var(--faint); margin-left: auto; }
.entry .rocklink { font-size: 13px; color: var(--muted); text-decoration: none; }
.entry .rocklink:hover { color: var(--ink); }
.empty-note {
  border: 1.5px dashed #c2b28a; border-radius: 16px; padding: 22px;
  text-align: center; color: var(--faint); font-size: 14px;
}

/* ------- form ------- */
.field {
  background: var(--field); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font-family: inherit; font-size: 15px; color: inherit; min-width: 0;
}
.field:focus { border-color: var(--stamp); outline: none; }
textarea.field { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }
.form-error { font-size: 13px; color: var(--stamp); }
.char-count { font-size: 12px; color: var(--faint); text-align: right; }
.hp { position: absolute; left: -9999px; top: -9999px; }
.btn-stamp {
  align-self: flex-start; background: var(--stamp); color: var(--paper); border: none;
  border-radius: 12px; padding: 12px 22px; font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive;
  font-weight: 700; font-size: 16px; cursor: pointer; transform: rotate(-1deg);
  box-shadow: 2px 3px 0 rgba(59, 51, 37, 0.25);
}
.btn-stamp:hover { transform: rotate(-1deg) translate(-1px, -1px); box-shadow: 3px 4px 0 rgba(59, 51, 37, 0.3); }
.btn-stamp:active { transform: rotate(-1deg) translate(1px, 1px); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }

/* ------- stamped confirmation ------- */
.stamped {
  border: 2.5px solid var(--stamp); border-radius: 18px 22px 18px 24px;
  padding: 18px 20px; transform: rotate(-0.8deg);
  display: flex; flex-direction: column; gap: 8px; background: var(--paper);
}
.stamped .big { font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; font-size: 20px; color: var(--stamp); }
.stamped .rest { color: var(--soft); }
.linkish {
  align-self: flex-start; background: none; border: none; padding: 0; cursor: pointer;
  font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; font-size: 14px;
  color: var(--muted); text-decoration: underline;
}
.linkish:hover { color: var(--ink); }

/* ------- admin ------- */
.admin-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.admin-row:last-child { border-bottom: none; }
.admin-row .grow { flex: 1; min-width: 140px; }
.admin-row .meta { font-size: 12.5px; color: var(--muted); }
.btn-sm {
  background: var(--field); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 5px 12px; cursor: pointer; font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive;
  font-weight: 700; font-size: 13px; color: var(--soft); text-decoration: none; display: inline-block;
}
.btn-sm:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm.danger { color: var(--stamp); border-color: color-mix(in oklab, var(--stamp) 40%, var(--line)); }
.btn-sm.go { background: var(--stamp); color: var(--paper); border-color: var(--stamp); }
.admin-form { display: flex; flex-direction: column; gap: 10px; }
.admin-form label { font-size: 13px; color: var(--soft); display: flex; flex-direction: column; gap: 4px; }
.inline-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-fields > label { flex: 1; min-width: 130px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px 12px; color: var(--muted); overflow-wrap: anywhere;
}

/* ------- QR sheet ------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.qr-cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 14px; padding: 16px;
  break-inside: avoid; page-break-inside: avoid;
}
.qr-cell img { width: 160px; height: 160px; image-rendering: pixelated; }
.qr-cell .name { font-family: 'Shantell Sans', 'Zen Maru Gothic', cursive; font-weight: 700; font-size: 17px; }
.qr-cell .meta { font-size: 12px; color: var(--muted); }
@media print {
  .no-print { display: none !important; }
  .page { padding: 0; }
  body { background: #fff; }
}
