/* Palette from an OS map: magenta cover, lichen paper, footpath green, water blue. */
:root {
  color-scheme: light;
  --pink: #b5125f;
  --pink-dark: #8c0c49;
  --paper: #eef1e3;
  --sheet: #fbfcf6;
  --peat: #24211c;
  --peat-soft: #5a564c;
  --moor: #dde5cc;
  --path: #256630;
  --water: #16608f;
  --rule: #c7cdb6;
  --error: #a3161f;
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --body: 'Overpass', 'Segoe UI', system-ui, sans-serif;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--peat);
  font: 400 1.0625rem/1.55 var(--body);
}

h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; }

/* Map cover */
.cover {
  background: var(--pink) url('/contours.svg') center / cover no-repeat;
  color: #fff;
}
.cover-inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6.5rem) 1rem clamp(2.5rem, 6vw, 4.5rem);
}
.cover h1 {
  font-size: clamp(4.25rem, 15vw, 9rem);
  line-height: 0.88;
  max-width: 10ch;
}
.cover-lede {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-size: clamp(1.125rem, 2.6vw, 1.375rem);
  line-height: 1.4;
}
.cover-meta { margin-top: 0.75rem; font-weight: 600; }
.cover-now {
  max-width: 34rem;
  margin-top: 1.75rem;
  padding-left: 0.9rem;
  border-left: 4px solid #fff;
}
.cover-now-label { font-size: 0.95rem; }
.cover-now-dare { font: 700 clamp(1.5rem, 4vw, 2.1rem)/1.1 var(--display); margin-top: 0.2rem; }
.cover .button { margin-top: 1.75rem; }

/* Buttons */
.button {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem 0.5rem;
  border: 2px solid var(--pink);
  border-radius: 3px;
  background: var(--pink);
  color: #fff;
  font: 800 1rem/1.3 var(--body);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.button:hover { background: var(--pink-dark); border-color: var(--pink-dark); }
.button[disabled], .button[aria-disabled='true'] { background: var(--rule); border-color: var(--rule); color: var(--peat-soft); cursor: not-allowed; }
.button-quiet { background: transparent; color: var(--pink); }
.button-quiet:hover { background: var(--pink); border-color: var(--pink); color: #fff; }
.button-invert { background: #fff; border-color: #fff; color: var(--pink); }
.button-invert:hover { background: var(--paper); border-color: var(--paper); color: var(--pink-dark); }
.cover :focus-visible { outline-color: #fff; }

/* Board */
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }

/* Everest sits in its own band, above the lists, so no line ever crosses a dare. */
.dares-head {
  padding: clamp(9rem, 24vw, 16rem) 0 1rem;
  background: url('/everest.svg') 38% 100% / auto 100% no-repeat;
  scroll-margin-top: 0.5rem;
}
.dares-head h2, .how h2 { font-size: clamp(3rem, 10vw, 5rem); }
.raised { margin-top: 0.5rem; color: var(--peat-soft); }
.raised strong { color: var(--peat); }

.dare-section { padding-top: 1.75rem; padding-bottom: 2.5rem; }
.dare-section h3 { font-size: clamp(2rem, 6vw, 2.75rem); }
.section-note { margin-top: 0.35rem; color: var(--peat-soft); max-width: 36rem; }

/* Individual dares get their own stretch of moor. */
.walker-band {
  --rule: #b4bd9d;
  background: var(--moor);
  border-top: 6px solid var(--peat);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.tab {
  flex: none;
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem 0.35rem;
  border: 2px solid var(--peat);
  border-radius: 999px;
  background: transparent;
  color: var(--peat);
  font: 600 1rem/1.2 var(--body);
  cursor: pointer;
}
.tab[aria-pressed='true'] { background: var(--peat); color: #fff; }

.status, .closed-note { margin-top: 1.25rem; color: var(--peat-soft); }
.closed-note { font-weight: 600; color: var(--peat); }

.dares { list-style: none; margin: 1.25rem 0 1.5rem; padding: 0; }
.dare {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.1rem 0.6rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.dare:first-child { border-top: 0; }
.dare-rank { font: 700 1.5rem/1.2 var(--display); color: var(--peat-soft); }
.dare-winning .dare-rank { color: var(--pink); }
.dare-body { min-width: 0; }
.dare-title { font: 800 1.125rem/1.3 var(--body); overflow-wrap: anywhere; }
.dare-detail { color: var(--peat-soft); margin-top: 0.15rem; overflow-wrap: anywhere; }
.dare-by { font-size: 0.9rem; color: var(--peat-soft); margin-top: 0.15rem; overflow-wrap: anywhere; }
.dare-money { text-align: right; font-variant-numeric: tabular-nums; }
.dare-total { font: 900 1.75rem/1.1 var(--display); }
.dare-winning .dare-total { color: var(--pink); }
.dare-pending { font-size: 0.8rem; line-height: 1.25; color: var(--peat-soft); max-width: 6.5rem; margin-left: auto; }
.dare-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.dare-actions .button { min-height: 2.75rem; }
.dare-highlight { background: #fff; box-shadow: -0.5rem 0 0 #fff, 0.5rem 0 0 #fff; }

/* The footpath: everything above it gets done. */
.cut {
  padding: 0.55rem 0 0.4rem;
  border-top: 3px dashed var(--path);
  border-bottom: 3px dashed var(--path);
  color: var(--path);
  font-weight: 800;
  text-align: center;
}
.cut + .dare { border-top: 0; }

/* How it works */
.how { padding-top: 2.5rem; padding-bottom: 3rem; }
.how h3 { font-size: 1.75rem; margin: 2rem 0 0.5rem; }
.how p { max-width: 38rem; margin-top: 0.6rem; }
.steps { margin: 1.25rem 0 0; padding-left: 1.5rem; max-width: 38rem; }
.steps li { margin-top: 0.6rem; padding-left: 0.25rem; }

.foot { padding: 1.5rem 1rem 2.5rem; background: var(--peat); color: #fff; text-align: center; font-size: 0.95rem; }

/* Dialogs */
.sheet {
  width: min(32rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: 1.5rem 1.25rem;
  border: 0;
  border-top: 8px solid var(--pink);
  border-radius: 4px;
  background: var(--sheet);
  color: var(--peat);
}
.sheet::backdrop { background: rgb(36 33 28 / 0.65); }
.sheet h2 { font-size: 2.25rem; padding-right: 2.5rem; }
.sheet-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  color: var(--peat);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.sheet-dare { margin-top: 0.4rem; font-weight: 800; overflow-wrap: anywhere; }
.donate-steps { margin: 1.25rem 0 0; padding-left: 1.4rem; }
.donate-steps > li { margin-top: 1.25rem; }
.donate-steps p { margin-bottom: 0.5rem; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.code-row code {
  padding: 0.45rem 0.7rem 0.3rem;
  border: 2px dashed var(--path);
  font: 800 1.25rem/1.3 var(--body);
  letter-spacing: 0.04em;
  user-select: all;
}

label { display: block; margin-top: 0.9rem; margin-bottom: 0.25rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  border: 2px solid var(--peat-soft);
  border-radius: 3px;
  background: #fff;
  color: var(--peat);
  font: 400 1rem/1.4 var(--body);
}
form .button { margin-top: 1rem; }
.hint { margin-top: 0.9rem; font-size: 0.95rem; color: var(--peat-soft); }
.form-error { margin-top: 0.75rem; color: var(--error); font-weight: 600; }
.done { margin: 1.25rem 0 1rem; font-size: 1.125rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (min-width: 40rem) {
  .dare-total { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Admin */
.admin { max-width: 52rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
.admin h1 { font-size: 3rem; }
.admin section { margin-top: 2.5rem; }
.admin h2 { font-size: 2rem; margin-bottom: 0.5rem; }
.admin h3 { font-size: 1.5rem; margin-top: 2rem; }
.admin-item { padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.admin-item-title { font-weight: 800; overflow-wrap: anywhere; }
.admin-item-meta { color: var(--peat-soft); font-size: 0.95rem; overflow-wrap: anywhere; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.admin-form { max-width: 30rem; }
.admin-note { color: var(--peat-soft); }
.admin-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.admin-check input { width: 1.25rem; min-height: 1.25rem; }
.admin-link { color: var(--water); font-weight: 600; }
