/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Page is a deep aged wood/leather backdrop the parchment sits on */
  --page-bg:        #3a2a1a;
  --page-bg-glow:   #5a3d24;

  /* Parchment palette */
  --parchment:      #f1dcb0;
  --parchment-edge: #c8a96b;
  --parchment-shadow: rgba(60, 30, 0, .35);
  --ink:            #2a1a0a;
  --ink-soft:       #5a3b1c;
  --ink-muted:      #8a6a3c;
  --rule:           #b48a4c;

  /* Status accents — desaturated to fit the period palette */
  --open-tint:      transparent;
  --partial-tint:   rgba(212, 160, 23, .12);
  --full-tint:      rgba(0, 0, 0, .04);

  --stamp-red:      #a12d20;
  --danger:         #a12d20;

  --radius:         4px;
  --shadow-tile:    0 2px 4px rgba(0,0,0,.35), 0 8px 22px rgba(0,0,0,.25);
}

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: "Special Elite", "Courier New", Courier, monospace;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(ellipse at top, var(--page-bg-glow) 0%, var(--page-bg) 60%, #1f1408 100%) fixed;
  min-height: 100vh;
}

/* Faint pioneer-motif overlay (wagons, wheels, oxen, handcarts) drawn in
   parchment-coloured strokes, screened back so it reads as wallpaper. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/static/pattern.svg");
  background-repeat: repeat;
  background-size: 380px 380px;
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}

/* Make sure real content sits above the overlay. */
.site-header, .flash-stack, .container, .site-footer {
  position: relative;
  z-index: 1;
}

a { color: var(--ink-soft); }
a:hover { color: var(--ink); }

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

.container { max-width: 920px; margin: 0 auto; padding: 1rem; }

/* ----- Header ----- */
.site-header {
  background:
    linear-gradient(rgba(20, 10, 0, .35), rgba(20, 10, 0, .35)),
    repeating-linear-gradient(
      90deg,
      #5b3a1d 0px, #5b3a1d 6px,
      #4a2f17 6px, #4a2f17 12px
    );
  color: #f6e6c4;
  padding: 1.25rem 1rem;
  border-bottom: 4px double #2a1a0a;
  box-shadow: 0 4px 12px rgba(0,0,0,.45);
}
.header-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.logo {
  height: 140px;
  width: auto;
  background: var(--parchment);
  border-radius: 6px;
  padding: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.event-org {
  margin: 0 0 .4rem;
  font-family: "IM Fell English SC", "Georgia", serif;
  font-size: 1rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: #e8d4a8;
  border-bottom: 1px solid rgba(232, 212, 168, .35);
  padding-bottom: .35rem;
}
.header-text h1 {
  margin: 0;
  font-family: "Rye", "Georgia", serif;
  font-size: 2rem;
  line-height: 1.15;
  color: #f6e6c4;
  text-shadow: 2px 2px 0 #1a0e04, 4px 4px 0 rgba(0,0,0,.3);
  letter-spacing: .02em;
}
.event-meta {
  margin: .4rem 0 0;
  font-family: "IM Fell English SC", "Georgia", serif;
  font-size: 1.1rem;
  color: #e8d4a8;
  letter-spacing: .03em;
}

@media (max-width: 560px) {
  .header-inner { flex-direction: column; text-align: center; gap: 1rem; }
  .logo { height: 110px; }
  .header-text h1 { font-size: 1.5rem; }
}

/* ----- Flash messages ----- */
.flash-stack {
  max-width: 920px; margin: 1rem auto 0; padding: 0 1rem;
}
.flash {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: .5rem;
  border: 2px solid;
  font-family: "IM Fell English SC", serif;
  font-size: 1.05rem;
  background: var(--parchment);
  box-shadow: var(--shadow-tile);
}
.flash-ok    { color: #3d5a1a; border-color: #6f8a3a; }
.flash-error { color: var(--stamp-red); border-color: var(--stamp-red); }

/* ----- Intro ----- */
.intro {
  background: var(--parchment);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--parchment-edge);
  box-shadow: var(--shadow-tile);
  margin-bottom: 1.5rem;
  font-family: "IM Fell English SC", "Georgia", serif;
  font-size: 1.05rem;
}
.intro p { margin: .35rem 0; }
.small { font-size: .9rem; color: var(--ink-muted); font-family: "Special Elite", monospace; }

.pill {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 2px;
  font-family: "IM Fell English SC", serif;
  font-size: .95rem;
  font-weight: 600;
  border: 1px solid var(--ink-soft);
  background: var(--parchment);
}
.pill-open    { background: #d8e6b8; color: #3d5a1a; border-color: #6f8a3a; }
.pill-partial { background: #f6e2a8; color: #7a5a00; border-color: #b48a30; }
.pill-full    { background: #d6cdc0; color: #5a4a3a; border-color: #8a7a6a; }

/* ----- Groups & booths ----- */
.group { margin-top: 2.5rem; }
.group h2 {
  margin: 0 0 1rem;
  font-family: "Rye", "Georgia", serif;
  font-size: 1.6rem;
  color: #f1dcb0;
  text-shadow: 2px 2px 0 #1a0e04;
  letter-spacing: .04em;
  border-bottom: 3px double #b48a4c;
  padding-bottom: .35rem;
}

.booth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .booth-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- The parchment "Wanted" tile ---------- */
.booth {
  position: relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,240,200,.35), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(120, 80, 30, .15), transparent 55%),
    radial-gradient(circle at 15% 70%, rgba(140, 90, 30, .08), transparent 30%),
    radial-gradient(circle at 85% 30%, rgba(140, 90, 30, .10), transparent 25%),
    linear-gradient(180deg, #f3dfb4 0%, #ead2a0 100%);
  border: 1px solid var(--parchment-edge);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow-tile);
  font-family: "IM Fell English SC", "Georgia", serif;
  overflow: hidden;
  /* outer "torn paper" frame: thick inner border, jagged via inset shadow */
  outline: 1px solid rgba(80, 50, 20, .15);
  outline-offset: -8px;
}
/* subtle tack-up rotation, alternating per child */
.booth-grid > .booth:nth-child(4n+1) { transform: rotate(-.4deg); }
.booth-grid > .booth:nth-child(4n+2) { transform: rotate(.5deg); }
.booth-grid > .booth:nth-child(4n+3) { transform: rotate(.25deg); }
.booth-grid > .booth:nth-child(4n)   { transform: rotate(-.3deg); }

.booth-open    { /* default parchment */ }
.booth-partial { background-color: var(--partial-tint); }
.booth-full    {
  filter: grayscale(.35) brightness(.94);
}

/* "WANTED" eyebrow at the top of every tile */
.wanted-label {
  font-family: "Rye", "Georgia", serif;
  font-size: 1.1rem;
  letter-spacing: .35em;
  text-align: center;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0 0 .5rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--ink);
}

.booth-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  margin-top: .25rem;
}
.booth-head h3 {
  margin: 0;
  font-family: "Rye", "Georgia", serif;
  font-size: 1.4rem;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.count {
  font-family: "IM Fell English SC", serif;
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.reward {
  text-align: center;
  font-family: "IM Fell English SC", serif;
  color: var(--ink-soft);
  margin: .25rem 0 .5rem;
  font-style: italic;
}

.note {
  margin: .5rem 0;
  color: var(--ink-soft);
  font-family: "IM Fell English SC", serif;
  font-style: italic;
  font-size: 1rem;
  text-align: center;
}

.signups {
  list-style: none;
  padding: 0;
  margin: .75rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.signups li {
  padding: .35rem .25rem;
  border-bottom: 1px dashed rgba(120, 80, 30, .35);
  font-family: "Special Elite", monospace;
  font-size: 1rem;
  color: var(--ink);
}
.signups li:last-child { border-bottom: 0; }
.open-slot { color: var(--ink-muted); font-style: italic; }

.full-label {
  margin: .5rem 0 0;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
  font-family: "IM Fell English SC", serif;
}

/* Red diagonal "FILLED" stamp on full booths */
.stamp {
  position: absolute;
  top: 38%;
  right: -10%;
  transform: rotate(-18deg);
  font-family: "Rye", "Georgia", serif;
  font-size: 2.6rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--stamp-red);
  border: 4px double var(--stamp-red);
  padding: .15rem 1rem;
  background: rgba(255, 240, 200, .25);
  pointer-events: none;
  opacity: .85;
  text-shadow: 1px 1px 0 rgba(255,255,255,.4);
  box-shadow: 0 0 0 2px rgba(161, 45, 32, .15);
}

/* ----- Claim form (inside the tile) ----- */
.claim-form {
  display: grid;
  gap: .55rem;
  margin-top: .75rem;
  padding-top: .5rem;
}
.claim-form input[type=text],
.claim-form input[type=tel],
.login-form input,
.cap-form input,
.add-form input {
  width: 100%;
  padding: .7rem .75rem;
  border: 1px solid var(--parchment-edge);
  border-radius: 3px;
  font-size: 1rem;
  font-family: "Special Elite", monospace;
  background: rgba(255, 250, 235, .85);
  color: var(--ink);
}
.claim-form input:focus,
.login-form input:focus {
  outline: 2px solid var(--ink-soft);
  outline-offset: 1px;
  background: #fffbf0;
}
.claim-form input::placeholder { color: rgba(90, 60, 30, .55); }

button, .btn-link {
  background: var(--ink);
  color: var(--parchment);
  border: 2px solid var(--ink);
  padding: .75rem 1rem;
  border-radius: 3px;
  font-size: 1.05rem;
  font-family: "Rye", "Georgia", serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: 0 2px 0 rgba(0,0,0,.3);
  transition: transform .05s;
}
button:hover, .btn-link:hover { background: #1a0e04; color: var(--parchment); }
button:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
button.danger { background: var(--danger); border-color: var(--danger); }
button.danger:hover { background: #7a1f15; }
button.link {
  background: transparent;
  color: var(--ink-soft);
  padding: 0;
  font-family: "Special Elite", monospace;
  font-size: .9rem;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: underline;
  border: 0;
  box-shadow: none;
}
button.link.danger { color: var(--danger); }
.inline { display: inline; }

/* ----- "Your sign-ups" box ----- */
.your-signups {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--parchment);
  border: 2px solid var(--parchment-edge);
  box-shadow: var(--shadow-tile);
  font-family: "IM Fell English SC", serif;
}
.your-signups h2 {
  margin: 0 0 .5rem;
  font-family: "Rye", "Georgia", serif;
  font-size: 1.3rem;
  color: var(--ink);
}

/* ----- Release page ----- */
.release-page {
  max-width: 480px;
  margin: 1.5rem auto;
  background: var(--parchment);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--parchment-edge);
  box-shadow: var(--shadow-tile);
}
.release-page h2 {
  font-family: "Rye", "Georgia", serif;
  margin-top: 0;
  color: var(--ink);
}
.release-card {
  background: rgba(255, 250, 235, .6);
  border: 1px dashed var(--rule);
  border-radius: 3px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: "IM Fell English SC", serif;
}
.release-booth { font-family: "Rye", serif; font-size: 1.2rem; margin: 0; color: var(--ink); }
.release-name  { margin: .25rem 0 .5rem; font-size: 1.1rem; }
.release-form  { display: flex; gap: .75rem; align-items: center; }

/* ----- Login page ----- */
.login-page {
  max-width: 360px;
  margin: 2rem auto;
  background: var(--parchment);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--parchment-edge);
  box-shadow: var(--shadow-tile);
}
.login-page h2 {
  font-family: "Rye", "Georgia", serif;
  margin-top: 0;
  color: var(--ink);
}
.login-form { display: grid; gap: .75rem; }
.login-form span {
  font-weight: 600;
  display: block;
  margin-bottom: .25rem;
  font-family: "IM Fell English SC", serif;
}

/* ----- Admin ----- */
.admin-page {
  background: var(--parchment);
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--parchment-edge);
  box-shadow: var(--shadow-tile);
}
.admin-page h2 {
  margin: 0;
  font-family: "Rye", "Georgia", serif;
  color: var(--ink);
}
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-actions { display: flex; gap: 1rem; align-items: center; }
.admin-group-head {
  margin: 1.5rem 0 .5rem;
  padding-bottom: .25rem;
  border-bottom: 2px solid var(--rule);
  font-family: "Rye", "Georgia", serif;
  color: var(--ink);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 250, 235, .5);
  font-family: "Special Elite", monospace;
  font-size: .95rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.admin-table th {
  background: rgba(180, 138, 76, .25);
  font-family: "IM Fell English SC", serif;
  font-weight: 600;
}
.admin-table .num { font-variant-numeric: tabular-nums; }

.admin-signups { list-style: none; padding: 0; margin: 0; }
.admin-signups li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  padding: .15rem 0;
}

.cap-form, .add-form { display: flex; gap: .25rem; flex-wrap: wrap; }
.cap-form input    { width: 4.5rem; padding: .35rem .4rem; }
.add-form input    { padding: .35rem .5rem; }
.add-form input[name=volunteer_name] { width: 9rem; }
.add-form input[name=phone]          { width: 7rem; }
.cap-form button, .add-form button {
  padding: .35rem .7rem;
  font-size: .9rem;
}

@media (max-width: 720px) {
  .admin-table, .admin-table thead, .admin-table tbody,
  .admin-table tr, .admin-table td, .admin-table th { display: block; }
  .admin-table thead { display: none; }
  .admin-table tr {
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: rgba(255, 250, 235, .5);
    margin-bottom: .75rem;
    padding: .5rem;
  }
  .admin-table td { border: 0; padding: .3rem 0; }
}

/* ----- Footer ----- */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: #d8c69a;
  font-family: "IM Fell English SC", serif;
  font-size: .95rem;
  border-top: 3px double #5b3a1d;
  background: rgba(0,0,0,.15);
}
.site-footer a { color: #f1dcb0; }
.site-footer a:hover { color: #fff5d8; }
