/* ═══════════════════════════════════════════════════════════
   Donate Wall — simple board + varied stuck paper notes
   ═══════════════════════════════════════════════════════════ */

.dw {
  --dw-brand: #29ABE2;
  --dw-teal: #0d9488;
  --dw-ink: #1c1917;
  --dw-muted: #78716c;
  --dw-paper: #fffbeb;
  font-family: "Vazirmatn", sans-serif;
  direction: rtl;
  color: var(--dw-ink);
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(41, 171, 226, .08), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(13, 148, 136, .07), transparent 45%),
    #f4f6f8;
}

/* ── Hero ── */
.dw-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 7.25rem 1.25rem 2.75rem;
  background:
    linear-gradient(160deg, rgba(14, 116, 144, .97), rgba(41, 171, 226, .9) 55%, rgba(13, 148, 136, .95));
  color: #fff;
}

.dw-hero-glow {
  position: absolute;
  inset: -30% -10% auto;
  height: 90%;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .28), transparent 62%);
}

.dw-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.dw-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: rgba(255, 255, 255, .85);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 1rem;
}

.dw-back:hover {
  color: #fff;
  text-decoration: none;
}

.dw-brand-row {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.dw-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
}

.dw-brand {
  margin: 0;
  font-size: clamp(1.85rem, 4.5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -.02em;
}

.dw-title {
  margin: .55rem 0 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.dw-sub {
  margin: .55rem auto 0;
  max-width: 28rem;
  font-size: .9rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, .8);
  font-weight: 600;
}

.dw-count {
  display: inline-block;
  margin: 1.1rem 0 0;
  padding: .4rem 1rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
}

/* ── Stage ── */
.dw-stage {
  position: relative;
  max-width: 1180px;
  margin: -1.25rem auto 0;
  padding: 0 1rem 3.5rem;
}

/* ══════════════════════════════════
   Simple board frame (no brick art)
   ══════════════════════════════════ */
.dw-wall {
  position: relative;
  min-height: 55vh;
  padding: 2rem clamp(.9rem, 2.5vw, 2rem) 2.5rem;
  border-radius: 18px;
  background: #ece8e1;
  border: 1px solid #d6d0c6;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .7) inset,
    0 18px 40px rgba(28, 25, 23, .08);
}

.dw-wall::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(120, 113, 108, .28);
  pointer-events: none;
}

/* ── Notes grid ── */
.dw-notes {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2.1rem 1.5rem;
  align-items: start;
}

/* ── Base paper note ── */
.dw-note {
  --dw-rot: -1.2deg;
  --dw-delay: 0ms;
  --dw-dur: 520ms;
  --dw-paper-bg: var(--dw-paper);
  --dw-accent: #29ABE2;
  position: relative;
  padding: 1.2rem 1.05rem 1.05rem 1.15rem;
  background-color: var(--dw-paper-bg);
  background-image:
    linear-gradient(transparent 22px, rgba(180, 165, 140, .28) 23px, transparent 24px);
  background-size: 100% 23px;
  box-shadow:
    1px 2px 0 rgba(255, 255, 255, .55) inset,
    2px 4px 10px rgba(28, 25, 23, .14),
    6px 10px 22px rgba(28, 25, 23, .1);
  transform: translateY(-36px) rotate(var(--dw-rot)) scale(.95);
  opacity: 0;
  filter: blur(2px);
  will-change: transform, opacity, filter;
}

/* pastel paper colors */
.dw-note:nth-child(7n + 1) { --dw-paper-bg: #fff9db; }
.dw-note:nth-child(7n + 2) { --dw-paper-bg: #fde8f1; }
.dw-note:nth-child(7n + 3) { --dw-paper-bg: #e4f1ff; }
.dw-note:nth-child(7n + 4) { --dw-paper-bg: #e7f8ee; }
.dw-note:nth-child(7n + 5) { --dw-paper-bg: #ffe9d6; }
.dw-note:nth-child(7n + 6) { --dw-paper-bg: #f1e9ff; }
.dw-note:nth-child(7n + 7) { --dw-paper-bg: #f5f0e6; }

/* rotation variety */
.dw-note:nth-child(5n + 1) { --dw-rot: -2.8deg; }
.dw-note:nth-child(5n + 2) { --dw-rot: 2.1deg; }
.dw-note:nth-child(5n + 3) { --dw-rot: -0.9deg; }
.dw-note:nth-child(5n + 4) { --dw-rot: 2.6deg; }
.dw-note:nth-child(5n + 5) { --dw-rot: -1.7deg; }

/* ── Shape variants (papers shouldn't look alike) ── */
.dw-note.is-shape-a {
  border-radius: 3px 16px 5px 14px / 4px 10px 16px 4px;
}

.dw-note.is-shape-b {
  border-radius: 2px 2px 2px 2px;
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 100%,
    88% 97%, 74% 100%, 58% 96%, 42% 100%, 26% 97%, 12% 100%, 0% 96%
  );
}

.dw-note.is-shape-c {
  border-radius: 20px 4px 18px 3px;
  padding-top: 1.4rem;
}

.dw-note.is-shape-d {
  border-radius: 2px;
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 92%,
    94% 100%, 0% 100%
  );
}

.dw-note.is-shape-d::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 18px 18px;
  border-color: transparent transparent rgba(0, 0, 0, .08) transparent;
  pointer-events: none;
}

.dw-note.is-shape-e {
  border-radius: 40% 3px 14px 10px / 10% 3px 14px 12%;
}

.dw-note.is-shape-f {
  border-radius: 3px;
  padding-top: 1.45rem;
}

.dw-note.is-shape-f::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 20px 20px 0 0;
  border-color: rgba(0, 0, 0, .07) transparent transparent transparent;
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, .06));
  pointer-events: none;
}

.dw-note.is-shape-g {
  border-radius: 4px 24px 6px 20px;
  clip-path: polygon(
    0% 0%, 100% 0%, 97% 100%, 0% 96%
  );
}

/* type accent strip */
.dw-note::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: 0;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: var(--dw-accent);
  opacity: .8;
}

.dw-note.is-donate   { --dw-accent: #29ABE2; }
.dw-note.is-birthday { --dw-accent: #f472b6; }
.dw-note.is-campaign { --dw-accent: #fb923c; }
.dw-note.is-article  { --dw-accent: #a78bfa; }
.dw-note.is-wishlist { --dw-accent: #34d399; }

/* ── Fasteners: pin / tape / clip ── */
.dw-pin {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ef4444, #b91c1c 70%, #7f1d1d);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, .35),
    inset 0 1px 2px rgba(255, 255, 255, .35);
  z-index: 3;
  pointer-events: none;
}

.dw-pin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  transform: translate(-60%, -65%);
}

.dw-tape {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg) scaleX(0);
  width: 54px;
  height: 15px;
  border-radius: 1px;
  background: rgba(255, 220, 150, .78);
  border: 1px solid rgba(200, 160, 90, .4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  z-index: 3;
  pointer-events: none;
  opacity: .9;
}

.dw-tape::before,
.dw-tape::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 8px;
  height: 10px;
  background: rgba(255, 255, 255, .28);
  border-radius: 1px;
}

.dw-tape::before { left: 6px; }
.dw-tape::after  { right: 6px; }

.dw-clip {
  position: absolute;
  top: -14px;
  right: 18%;
  width: 18px;
  height: 28px;
  border: 2.5px solid #94a3b8;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  transform: scale(0) rotate(8deg);
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.dw-clip::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 6px;
  height: 14px;
  border: 1.5px solid #cbd5e1;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
}

/* show one fastener by shape */
.dw-note .dw-pin,
.dw-note .dw-tape,
.dw-note .dw-clip { display: none; }

.dw-note.is-shape-a .dw-pin,
.dw-note.is-shape-d .dw-pin,
.dw-note.is-shape-g .dw-pin { display: block; }

.dw-note.is-shape-b .dw-tape,
.dw-note.is-shape-e .dw-tape { display: block; }

.dw-note.is-shape-c .dw-clip,
.dw-note.is-shape-f .dw-clip { display: block; }

.dw-note.is-shape-e .dw-tape {
  left: 28%;
  width: 44px;
  transform: translateX(-50%) rotate(8deg) scaleX(0);
  background: rgba(167, 220, 255, .75);
  border-color: rgba(90, 160, 200, .4);
}

.dw-note.is-shape-c .dw-clip {
  right: auto;
  left: 22%;
  transform: scale(0) rotate(-12deg);
}

/* ── Slap animation ── */
@keyframes dw-slap {
  0% {
    opacity: 0;
    transform: translateY(-40px) rotate(calc(var(--dw-rot) - 8deg)) scale(.9);
    filter: blur(3px);
  }
  45% {
    opacity: 1;
    transform: translateY(6px) rotate(calc(var(--dw-rot) + 2deg)) scale(1.03);
    filter: blur(0);
  }
  70% {
    transform: translateY(-3px) rotate(calc(var(--dw-rot) - 1deg)) scale(.99);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(var(--dw-rot)) scale(1);
    filter: blur(0);
  }
}

@keyframes dw-pin-pop {
  0%   { transform: translateX(-50%) scale(0) translateY(6px); }
  60%  { transform: translateX(-50%) scale(1.2) translateY(-1px); }
  100% { transform: translateX(-50%) scale(1) translateY(0); }
}

@keyframes dw-tape-pop {
  0%   { transform: translateX(-50%) rotate(-3deg) scaleX(0); opacity: 0; }
  60%  { transform: translateX(-50%) rotate(-1deg) scaleX(1.06); opacity: 1; }
  100% { transform: translateX(-50%) rotate(-3deg) scaleX(1); opacity: .9; }
}

@keyframes dw-tape-pop-tilt {
  0%   { transform: translateX(-50%) rotate(8deg) scaleX(0); opacity: 0; }
  60%  { transform: translateX(-50%) rotate(6deg) scaleX(1.06); opacity: 1; }
  100% { transform: translateX(-50%) rotate(8deg) scaleX(1); opacity: .9; }
}

@keyframes dw-clip-pop {
  0%   { transform: scale(0) rotate(8deg) translateY(8px); }
  65%  { transform: scale(1.1) rotate(6deg) translateY(-1px); }
  100% { transform: scale(1) rotate(8deg) translateY(0); }
}

@keyframes dw-clip-pop-tilt {
  0%   { transform: scale(0) rotate(-12deg) translateY(8px); }
  65%  { transform: scale(1.1) rotate(-10deg) translateY(-1px); }
  100% { transform: scale(1) rotate(-12deg) translateY(0); }
}

.dw-note.is-stuck {
  animation: dw-slap var(--dw-dur) cubic-bezier(.34, 1.45, .64, 1) var(--dw-delay) forwards;
}

.dw-note.is-stuck.is-shape-a .dw-pin,
.dw-note.is-stuck.is-shape-d .dw-pin,
.dw-note.is-stuck.is-shape-g .dw-pin {
  animation: dw-pin-pop 360ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--dw-delay) + 160ms) forwards;
}

.dw-note.is-stuck.is-shape-b .dw-tape {
  animation: dw-tape-pop 360ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--dw-delay) + 160ms) forwards;
}

.dw-note.is-stuck.is-shape-e .dw-tape {
  animation: dw-tape-pop-tilt 360ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--dw-delay) + 160ms) forwards;
}

.dw-note.is-stuck.is-shape-f .dw-clip {
  animation: dw-clip-pop 360ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--dw-delay) + 160ms) forwards;
}

.dw-note.is-stuck.is-shape-c .dw-clip {
  animation: dw-clip-pop-tilt 360ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--dw-delay) + 160ms) forwards;
}

.dw-note.is-stuck:hover {
  transform: translateY(-5px) rotate(var(--dw-rot)) scale(1.015);
  box-shadow:
    1px 2px 0 rgba(255, 255, 255, .55) inset,
    3px 8px 16px rgba(28, 25, 23, .18),
    8px 14px 28px rgba(28, 25, 23, .12);
  transition: transform .22s ease, box-shadow .22s ease;
  z-index: 2;
}

/* ── Note content ── */
.dw-note-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .75rem;
}

.dw-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .12);
}

.dw-av.is-anon {
  background: #94a3b8;
  border-color: rgba(148, 163, 184, .55);
}

.dw-meta {
  min-width: 0;
  flex: 1;
}

.dw-name {
  display: block;
  font-size: .88rem;
  font-weight: 800;
  color: var(--dw-ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-name:hover {
  color: var(--dw-brand);
  text-decoration: none;
}

.dw-from {
  display: block;
  font-size: .72rem;
  color: var(--dw-muted);
  font-weight: 600;
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-from a {
  color: var(--dw-teal);
  font-weight: 700;
  text-decoration: none;
}

.dw-from a:hover { text-decoration: underline; }

.dw-from em {
  font-style: normal;
  color: #a8a29e;
}

.dw-amount {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  margin-bottom: .55rem;
}

.dw-gift {
  font-size: 1.15rem;
  line-height: 1;
}

.dw-toman {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--dw-ink);
  letter-spacing: -.01em;
}

.dw-cur {
  font-size: .72rem;
  font-weight: 700;
  color: var(--dw-muted);
}

.dw-msg {
  margin: 0 0 .5rem;
  font-size: .82rem;
  line-height: 1.65;
  color: #44403c;
  font-weight: 500;
  word-break: break-word;
}

.dw-msg.is-empty {
  color: #a8a29e;
  font-style: italic;
}

.dw-time {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: #a8a29e;
}

.dw-note .donate-type-badge {
  position: absolute;
  top: .55rem;
  left: .55rem;
  z-index: 2;
}

/* ── Actions / footer ── */
.dw-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 1.5rem 1rem 0;
}

.dw-more {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.6rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--dw-brand), var(--dw-teal));
  box-shadow: 0 6px 20px rgba(41, 171, 226, .35);
  transition: transform .2s ease, box-shadow .2s ease;
}

.dw-more:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(41, 171, 226, .45);
}

.dw-more:disabled {
  opacity: .65;
  cursor: wait;
}

.dw-empty,
.dw-done {
  margin: 0;
  padding: .85rem 1.25rem;
  border-radius: 12px;
  font-size: .85rem;
  font-weight: 700;
  text-align: center;
  color: #57534e;
  background: #fff;
  border: 1px solid #e7e5e4;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .dw-note {
    opacity: 1;
    transform: rotate(var(--dw-rot));
    filter: none;
  }

  .dw-note.is-stuck { animation: none; }

  .dw-note.is-stuck .dw-pin {
    transform: translateX(-50%) scale(1);
  }

  .dw-note.is-stuck.is-shape-b .dw-tape {
    transform: translateX(-50%) rotate(-3deg) scaleX(1);
    opacity: .9;
  }

  .dw-note.is-stuck.is-shape-e .dw-tape {
    transform: translateX(-50%) rotate(8deg) scaleX(1);
    opacity: .9;
  }

  .dw-note.is-stuck.is-shape-f .dw-clip {
    transform: scale(1) rotate(8deg);
  }

  .dw-note.is-stuck.is-shape-c .dw-clip {
    transform: scale(1) rotate(-12deg);
  }

  .dw-note.is-stuck:hover { transition: none; }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .dw-hero { padding: 6.5rem 1rem 2.25rem; }

  .dw-stage {
    margin-top: -.75rem;
    padding: 0 .75rem 3rem;
  }

  .dw-wall {
    padding: 1.5rem .75rem 2rem;
    border-radius: 14px;
  }

  .dw-notes {
    grid-template-columns: 1fr;
    gap: 1.85rem;
  }

  .dw-note {
    max-width: 340px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .dw-notes {
    grid-template-columns: repeat(2, 1fr);
  }
}
