/* Curio Ramble — Folded Gallery-Guide Clue Board
   primary #4c5b5a · secondary #f3e5d0 · accent #c06b45 */

:root {
  --primary: #4c5b5a;
  --secondary: #f3e5d0;
  --accent: #c06b45;
  --mustard: #c79a3b;
  --ink: #2e3338;
  --paper: #faf3e7;
  --sand: #efe0c8;
  --line: #d9c5a5;
  --shadow: rgba(46, 51, 56, .18);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Georgia", "Iowan Old Style", serif;
  background: var(--sand);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.45;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- single-column board ---------- */
.board {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px calc(96px + env(safe-area-inset-bottom, 0px));
}

.view { padding-top: 4px; }

.view-head { margin: 8px 0 14px; }
.view-head h1 { font-size: 1.35rem; color: var(--primary); letter-spacing: .01em; }
.view-sub { font-size: .85rem; color: #6b6455; margin-top: 2px; }

.section-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #7a6f5a;
  margin: 0 0 8px 2px;
}

/* ---------- folded paper-guide header (Hunt) ---------- */
.guide-head {
  position: relative;
  background: var(--secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  margin-top: 8px;
  overflow: hidden;
}
.guide-crease {
  position: absolute; inset: 0;
  background:
    linear-gradient(115deg, transparent 46%, rgba(76,91,90,.10) 50%, transparent 54%),
    linear-gradient(250deg, transparent 62%, rgba(76,91,90,.07) 66%, transparent 70%);
  pointer-events: none;
}
.guide-kicker {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--accent); margin-bottom: 4px;
}
.guide-title { font-size: 1.7rem; color: var(--primary); line-height: 1.1; }
.guide-sub { font-size: .85rem; color: #6b6455; margin-top: 6px; max-width: 30ch; }

/* ---------- punched-ticket counters ---------- */
.counter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.punched-counter {
  position: relative;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 12px 10px 26px;
}
.punched-counter::before { /* punch hole */
  content: ""; position: absolute; left: 9px; top: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sand);
  border: 1px solid var(--line);
  transform: translateY(-50%);
}
.punched-counter .stage-word { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.punched-counter .count { font-size: 1.6rem; font-weight: bold; line-height: 1.1; }
.pc-searching .stage-word { color: var(--accent); }
.pc-searching .count { color: var(--accent); }
.pc-found .stage-word { color: var(--primary); }
.pc-found .count { color: var(--primary); }

/* ---------- rust add strip ---------- */
.add-strip {
  display: block; width: 100%;
  margin: 14px 0 18px;
  background: var(--accent);
  color: #fff7ee;
  font-family: inherit; font-size: 1rem; font-weight: bold;
  letter-spacing: .04em;
  border: none; border-radius: 12px;
  padding: 15px 16px;
  min-height: 52px;
  box-shadow: 0 2px 0 #95512f;
  cursor: pointer;
}
.add-strip:active { transform: translateY(1px); box-shadow: 0 1px 0 #95512f; }

/* ---------- next-Searching card ---------- */
.next-card {
  position: relative;
  background: var(--primary);
  color: var(--secondary);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: 0 6px 14px var(--shadow);
}
.next-card::before { /* perforation fold line */
  content: ""; position: absolute; left: 14px; right: 14px; top: 44px;
  border-top: 1px dashed rgba(243,229,208,.4);
}
.next-card .zone-chip {
  display: inline-block;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  background: rgba(243,229,208,.16);
  border-radius: 20px; padding: 3px 10px;
  margin-bottom: 8px;
}
.next-card .clue-title { font-size: 1.2rem; line-height: 1.2; color: #fdf6ea; }
.next-card .clue-hint { font-size: .85rem; color: rgba(243,229,208,.85); margin-top: 8px; }

/* ---------- slim torn-ticket rows ---------- */
.ticket-row {
  position: relative;
  display: flex; align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  animation: none;
}
.ticket-row::after { /* torn bottom edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 5px;
  background: repeating-linear-gradient(100deg,
    transparent 0 6px, var(--sand) 6px 8px, transparent 8px 14px);
  opacity: .9;
  pointer-events: none;
}
.stage-band {
  width: 9px; flex: 0 0 9px;
  border-radius: 0;
}
.band-rust   { background: var(--accent); }
.band-teal   { background: var(--primary); }
.band-mustard{ background: var(--mustard); }
.band-ink    { background: var(--ink); }

.ticket-body { flex: 1; padding: 10px 12px 12px; min-width: 0; }
.ticket-title { font-size: .98rem; color: var(--ink); line-height: 1.25; word-wrap: break-word; }
.ticket-meta { font-size: .74rem; color: #7a6f5a; margin-top: 3px; }
.ticket-hint { font-size: .8rem; color: #5d564a; margin-top: 5px; font-style: italic; }

.stage-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: .78rem; font-weight: bold;
  text-transform: uppercase; letter-spacing: .08em;
  background: none; border: none; padding: 6px 4px 0 0;
  cursor: pointer; min-height: 40px;
}
.stage-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }
.stage-dot.filled { background: currentColor; }
.stage-dot.hollow { background: transparent; border: 2px solid currentColor; }
.st-searching { color: var(--accent); }
.st-found     { color: var(--primary); }

.ticket-actions { display: flex; gap: 8px; margin-top: 6px; }
.mini-btn {
  font-family: inherit; font-size: .74rem; letter-spacing: .04em;
  border: 1px solid var(--line); background: var(--secondary);
  color: var(--primary);
  border-radius: 8px; padding: 8px 12px; min-height: 36px;
  cursor: pointer;
}
.mini-btn.danger { color: #8c3a1e; border-color: #c9a08a; }

/* inline edit panel inside a row */
.edit-panel {
  border-top: 1px dashed var(--line);
  margin-top: 10px; padding-top: 10px;
  display: grid; gap: 8px;
}
.edit-panel label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #7a6f5a; }
.edit-panel input, .edit-panel select {
  font-family: inherit; font-size: .95rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; width: 100%; min-height: 44px;
}
.edit-error { font-size: .78rem; color: #8c3a1e; }

/* ---------- form ticket (Add tab) ---------- */
.ticket-form { margin-top: 4px; }
.form-ticket {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
}
.form-ticket .punch {
  position: absolute; top: 14px; left: 14px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--sand); border: 1px solid var(--line);
}
.form-ticket label {
  display: block;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .12em;
  color: #7a6f5a; margin: 14px 0 5px;
}
.form-ticket label:first-of-type { margin-top: 0; }
.req { color: var(--accent); }
.opt { color: #a89c85; }
.form-ticket input, .form-ticket select {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; width: 100%; min-height: 48px;
}
.form-ticket input:focus, .form-ticket select:focus,
.edit-panel input:focus, .edit-panel select:focus, #find-input:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.form-error {
  margin-top: 12px;
  font-size: .82rem; color: #8c3a1e;
  background: #f6e3d6; border-radius: 8px; padding: 8px 10px;
}

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%;
  font-family: inherit; font-size: .95rem; font-weight: bold;
  letter-spacing: .03em;
  border: none; border-radius: 12px;
  padding: 14px; min-height: 50px;
  margin-top: 14px; cursor: pointer;
}
.btn-accent { background: var(--accent); color: #fff7ee; box-shadow: 0 2px 0 #95512f; }
.btn-accent:active { transform: translateY(1px); }
.btn-plain { background: var(--secondary); color: var(--primary); border: 1px solid var(--line); }
.btn-danger { background: #f3ded2; color: #8c3a1e; border: 1px solid #c9a08a; }

/* ---------- search (Find tab) ---------- */
.search-wrap { margin: 4px 0 14px; }
#find-input {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  width: 100%; min-height: 48px;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px;
  -webkit-appearance: none; appearance: none;
}
.result-note { font-size: .78rem; color: #7a6f5a; margin: 0 2px 10px; }

/* ---------- about panel ---------- */
.about-panel {
  margin-top: 22px;
  background: var(--secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}
.about-list { display: grid; gap: 8px; }
.about-list div { display: flex; gap: 10px; font-size: .84rem; }
.about-list dt { flex: 0 0 92px; color: #7a6f5a; }
.about-list dd { color: var(--ink); }

/* ---------- empty states ---------- */
.empty-state {
  text-align: center;
  padding: 26px 18px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty-state .crease {
  height: 26px; margin-bottom: 10px;
  background: linear-gradient(105deg, transparent 44%, rgba(76,91,90,.12) 50%, transparent 56%);
  border-radius: 4px;
}
.empty-state p { font-size: .88rem; color: #6b6455; max-width: 28ch; margin: 0 auto; }

/* ---------- bottom tab bar: museum-ticket silhouettes ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 6px;
  max-width: 480px; margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--primary);
}
.ticket-tab {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  min-height: 56px;
  background: var(--secondary);
  border: none; border-radius: 10px 10px 8px 8px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ticket-tab .punch {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  opacity: .25;
}
.ticket-tab .tab-word {
  font-family: inherit; font-size: .78rem; font-weight: bold;
  letter-spacing: .06em; color: #7a6f5a;
}
.ticket-tab[aria-selected="true"] {
  background: var(--paper);
  transform: rotate(-2deg) translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.ticket-tab[aria-selected="true"] .tab-word { color: var(--accent); }
.ticket-tab[aria-selected="true"] .punch { background: var(--accent); opacity: 1; }

/* ---------- group labels on Clues tab ---------- */
.group-head {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 8px;
}
.group-head .rule { flex: 1; border-top: 1px dashed var(--line); }
.group-head .stage-word { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; }
