/* A notice board on the mosque wall: one pinned sheet per night, sponsor names stuck into their own spaces.
   Sheets always hang straight for readability. The realistic look adds texture, frame depth, glossy pins
   and slightly off-square name labels. */
body {
  background: #ece6da;
}
.wall {
  --label: #fffef9;
  --pin: #a8432c;
  --mine: #fff1bf;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-o: 0.12;
  --frame: 12px;
  --sheet-shadow: 0 1px 2px #0002;
  --label-shadow: none;
  --label-tilt: 0deg;
  --light: none;
  padding: clamp(0px, 2vw, 24px);
}
.wall.realistic {
  --grain-o: 0.6;
  --frame: 16px;
  --sheet-shadow: 0 3px 4px #0003, 0 14px 28px #0004;
  --label-shadow: 0 1px 2px #0003, 0 2px 5px #0001;
  --label-tilt: 0.5deg;
  --light: radial-gradient(ellipse at 50% 0%, #ffffff26, transparent 60%), radial-gradient(ellipse at 50% 120%, #0000004d, transparent 60%);
}
.board {
  position: relative;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(14px, 2.6vw, 40px);
  background: var(--board);
  border: var(--frame) solid #5b3f27;
  border-radius: 4px;
  box-shadow: 0 2px 6px #0002;
}
.realistic .board {
  border-image: linear-gradient(145deg, #7a5536, #4a321f 45%, #6b4a2e) 1;
  box-shadow:
    inset 0 0 0 1px #0003,
    inset 0 2px 8px #0005,
    0 2px 4px #0002,
    0 18px 40px #0003;
}
.board::before,
.board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.board::before {
  background: var(--grain);
  opacity: var(--grain-o);
  mix-blend-mode: multiply;
}
.board::after {
  background: var(--light);
}
.board > * {
  position: relative;
  z-index: 1;
}

.pin {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  z-index: 2;
  background: var(--pin);
}
.realistic .pin {
  background: radial-gradient(circle at 35% 30%, #f08a74, var(--pin) 55%, #6e2416);
  box-shadow: 0 2px 3px #0005;
}
.pin-left {
  left: 24px;
}
.pin-right {
  left: auto;
  right: 16px;
}

/* The welcome card, with the mosque's own pinned slip beside it when there is room. */
.notices {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: clamp(20px, 3vw, 40px);
  margin: 0 0 clamp(20px, 3vw, 36px);
}
.notice.pinned {
  flex: 0 1 380px;
}
.realistic .notice.pinned {
  transform: rotate(1deg);
}
.pinned-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 64px;
  object-fit: contain;
  margin-bottom: 16px;
}
.pinned-image {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 16px;
}
.pinned-text {
  font-size: 17px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.pinned h2 {
  margin: 18px 0 10px;
  font-size: 24px;
}
.pinned h2:first-of-type:first-child,
.pinned .pin + h2 {
  margin-top: 0;
}
.pinned .contact {
  flex-direction: column;
  gap: 6px;
}
.notice {
  position: relative;
  flex: 1 1 520px;
  min-width: 0;
  max-width: 780px;
  margin: 0;
  padding: clamp(20px, 3vw, 34px);
  background: var(--paper);
  box-shadow: var(--sheet-shadow);
}
.title {
  margin-top: 6px;
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.02;
}
.when {
  margin-top: 10px;
  font-weight: 600;
}
.intro {
  margin-top: 8px;
  max-width: 60ch;
  color: var(--muted);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.raised {
  margin-top: 18px;
}
.raised p {
  margin-bottom: 6px;
}
progress {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  appearance: none;
  background: #e6dfd0;
}
progress::-webkit-progress-bar {
  background: #e6dfd0;
}
progress::-webkit-progress-value {
  background: var(--pin);
}
progress::-moz-progress-bar {
  background: var(--pin);
}
.utilities {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 20px;
  margin-top: 16px;
  font-size: 15px;
  font-weight: 600;
}
.utilities summary,
.utilities .toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.jump ol {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 4px;
  width: min(520px, 100%);
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.jump a {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.jump a[aria-current] {
  background: var(--strip);
  border-color: var(--ink);
}
.empty {
  padding: 16px 20px;
  background: var(--paper);
}

.sheets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: clamp(18px, 2.4vw, 30px);
  align-items: start;
}
.sheet {
  position: relative;
  background: var(--paper);
  border-top: 0;
  box-shadow: var(--sheet-shadow);
  scroll-margin-block: 24px;
}
.sheet:target {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
/* The night's strip ends in a progress bar that fills, in the pin's red like the board's other bars, as gifts are confirmed. */
.strip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
  padding: 18px 14px 22px;
  background: var(--strip);
}
.strip::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--pin) var(--raised, 0%), #00000024 var(--raised, 0%));
}
.night-raised {
  flex-basis: 100%;
  font-size: 13px;
}
.strip h2 {
  font-size: 25px;
}
.strip time {
  font-weight: 600;
  font-size: 14px;
}
.tonight .strip time {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 8px;
}
.foot {
  padding: 0 12px 10px;
  font-size: 13px;
  color: var(--muted);
}

.slot {
  position: relative;
  min-width: 0;
  min-height: 54px;
  padding: 3px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1px dashed var(--edge);
  border-radius: 2px;
}
.slot .amount {
  font-size: 14px;
}
.slot small {
  font-size: 11px;
  color: var(--muted);
}
.free {
  cursor: pointer;
}
.free:hover {
  background: #f3ecdd;
}
.free input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.free:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
  z-index: 2;
}
.free:has(input:checked) {
  border: 2px solid var(--pin);
  background: var(--mine);
}
.free:has(input:checked) .amount {
  color: var(--pin);
}
.free:has(input:checked) .amount::before {
  content: "✓ ";
}
.held {
  opacity: 0.55;
}
.taken {
  border: 1px solid #ddd3bf;
  background: var(--label);
  box-shadow: var(--label-shadow);
  transform: rotate(var(--label-tilt));
}
.taken:nth-child(3n) {
  transform: rotate(calc(var(--label-tilt) * -1.4));
}
.taken:nth-child(4n + 1) {
  transform: rotate(calc(var(--label-tilt) * 0.6));
}
.taken .amount {
  display: none;
}
.label {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  overflow-wrap: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tally {
  display: grid;
  gap: 6px;
  padding: 12px 14px 4px;
}
.names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 8px 14px;
  list-style: none;
}
.names .label {
  display: inline-block;
  -webkit-line-clamp: unset;
  padding: 6px 9px;
  background: var(--label);
  border: 1px solid #ddd3bf;
  box-shadow: var(--label-shadow);
  font-size: 13px;
}
.names .label:nth-child(odd) {
  transform: rotate(var(--label-tilt));
}
.names small {
  color: var(--muted);
  font-weight: 500;
}
.give {
  display: grid;
  gap: 6px;
  margin: 4px 14px 10px;
  font-weight: 600;
  font-size: 15px;
}
.give small {
  color: var(--muted);
  font-weight: 400;
}
.give input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px dashed var(--edge);
  border-radius: 4px;
  background: #fff;
  font: 600 18px var(--sans);
}
.money-input {
  display: flex;
  align-items: center;
  gap: 6px;
}
.money-input > span {
  font-weight: 700;
}

/* The tray follows the donor down the board once something is chosen. */
.tray {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 720px;
  margin: 24px auto 0;
  padding: 12px 14px 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 6px solid var(--strip);
  box-shadow: 0 6px 24px #0004;
}
.pick:not(:has(.free input:checked, .give input:not(:placeholder-shown))) .tray {
  display: none;
}
.tray-copy {
  font-weight: 700;
}
.continue {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font: 600 16px var(--sans);
  cursor: pointer;
}

@media (max-width: 560px) {
  .wall {
    padding: 0;
  }
  .board {
    border-width: 8px;
    border-radius: 0;
  }
  .slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .slot {
    min-height: 58px;
  }
  .label {
    font-size: 12.5px;
  }
  .tray {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    bottom: 0;
    margin-inline: -6px;
  }
}
/* The overall goal's card has no night to fill, so its strip has no bar. */
.overall .strip {
  padding-bottom: 8px;
}
.overall .strip::after {
  content: none;
}
