:root {
  --green: #1fa01f;
  --green-dark: #168a16;
  --yellow: #f4e83a;
  --gold: #c9b52a;
  --gold-light: #e8d65a;
  --white: #ffffff;
  --orange-1: #fbb03b;
  --orange-2: #e8540c;
  --red-1: #e3262c;
  --red-2: #9e0b10;
  --black: #000000;
  --font-comic: "Comic Sans MS", "Comic Neue", "Chalkboard SE", cursive;
  --font-serif: "Times New Roman", Times, Georgia, serif;
  --font-verdana: Verdana, Geneva, Tahoma, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --shadow-text: 1px 1px 0 rgba(0,0,0,.35);
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--yellow);
  font-family: var(--font-comic);
  background-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cdefs%3E%3Cpath id='s' d='M0-10 L1.6-1.6 10 0 1.6 1.6 0 10 -1.6 1.6 -10 0 -1.6-1.6Z'/%3E%3C/defs%3E%3Cg fill='%23fff8b0'%3E%3Cuse href='%23s' transform='translate(20 22) scale(1)'/%3E%3Cuse href='%23s' transform='translate(110 14) scale(.7)'/%3E%3Cuse href='%23s' transform='translate(160 70) scale(1.1)'/%3E%3Cuse href='%23s' transform='translate(64 84) scale(.8)'/%3E%3Cuse href='%23s' transform='translate(14 130) scale(.65)'/%3E%3Cuse href='%23s' transform='translate(120 120) scale(.9)'/%3E%3Cuse href='%23s' transform='translate(70 165) scale(.6)'/%3E%3Cuse href='%23s' transform='translate(165 165) scale(.55)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Ccircle cx='20' cy='22' r='1.6'/%3E%3Ccircle cx='160' cy='70' r='1.6'/%3E%3Ccircle cx='120' cy='120' r='1.4'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 180px 180px;
  overflow-x: hidden;
}

/* decor layer — z 2, never clickable */
.sparkles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.sparkle {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  background: radial-gradient(circle, #fff 0 12%, rgba(255,250,180,.9) 13% 20%, transparent 21%),
              linear-gradient(transparent 46%, #fff9c4 46% 54%, transparent 54%),
              linear-gradient(90deg, transparent 46%, #fff9c4 46% 54%, transparent 54%);
  filter: drop-shadow(0 0 4px rgba(255,255,200,.9));
  opacity: 0;
  animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}

/* CA bar — nav z 100 */
.ca-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(0,0,0,.88);
  border-bottom: 3px solid var(--gold);
  font-family: var(--font-mono);
  color: var(--white);
  font-size: 14px;
}
.ca-label { color: var(--yellow); font-weight: 700; }
.ca-value {
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}
.ca-copy {
  position: relative;
  z-index: 10;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  padding: 5px 12px;
  color: var(--black);
  background: linear-gradient(var(--gold-light), var(--gold));
  border: 2px outset #f3e48a;
}
.ca-copy:active { border-style: inset; }

/* content — z 5 */
.page {
  position: relative;
  z-index: 5;
  max-width: 560px;
  margin: 0 auto;
  padding: 26px 16px 40px;
  text-align: center;
}

.title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(54px, 13vw, 82px);
  line-height: 1;
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0,0,0,.35), 0 0 18px rgba(255,255,255,.25);
}

.subtitle {
  margin-top: 8px;
  font-size: clamp(18px, 4.5vw, 22px);
  color: var(--yellow);
  text-shadow: var(--shadow-text);
}

.portrait {
  display: inline-block;
  margin-top: 14px;
  padding: 10px;
  background: var(--gold);
  border: 2px solid #8f7f12;
  box-shadow: inset 0 0 0 2px var(--gold-light), 0 6px 18px rgba(0,0,0,.35);
}
.portrait img {
  display: block;
  width: min(260px, 64vw);
  height: auto;
  border: 2px solid #6d6110;
}

.dates {
  margin-top: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  text-shadow: var(--shadow-text);
}

.story {
  margin: 26px auto 0;
  max-width: 470px;
  text-align: left;
  font-weight: 700;
  text-shadow: var(--shadow-text);
}
.story p + p { margin-top: 14px; }
.story .lead { font-size: 16px; line-height: 1.35; }
.story .small { font-size: 13px; line-height: 1.35; }
.story.white { color: var(--white); font-size: 13px; line-height: 1.38; }

.big-lines {
  margin-top: 36px;
  font-size: clamp(20px, 5vw, 25px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--yellow);
  text-shadow: var(--shadow-text);
}
.big-lines p + p { margin-top: 26px; }
.ribboned {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ribbon {
  width: 26px;
  height: 46px;
  flex: 0 0 auto;
  pointer-events: none;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,.25));
}
.big-lines .cta-line { font-size: clamp(18px, 4.6vw, 23px); }

.banner {
  margin: 34px auto 0;
  max-width: 520px;
  padding: 14px 12px 12px;
  background: linear-gradient(180deg, var(--orange-1) 0%, #f5801f 45%, var(--orange-2) 100%);
  border: 2px solid #b8420a;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 6px 16px rgba(0,0,0,.3);
}
.banner-title {
  font-family: var(--font-verdana);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(28px, 7.8vw, 42px);
  line-height: 1.05;
  color: var(--yellow);
  text-shadow: -2px -2px 0 #6b2a00, 2px -2px 0 #6b2a00, -2px 2px 0 #6b2a00, 2px 2px 0 #6b2a00, 3px 4px 0 rgba(0,0,0,.35);
  border-bottom: 2px solid #f8e04a;
  padding-bottom: 6px;
  margin: 0 8px;
}
.banner-sub {
  margin-top: 6px;
  font-family: var(--font-verdana);
  font-weight: 700;
  font-size: clamp(12px, 3.2vw, 14px);
  color: #2b1100;
}

.donate {
  position: relative;
  z-index: 10;
  display: inline-block;
  margin-top: 26px;
  padding: 16px 30px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  color: var(--white);
  text-decoration: none;
  background: linear-gradient(180deg, var(--red-1) 0%, #c3141a 55%, var(--red-2) 100%);
  border: 3px outset #f05055;
  box-shadow: 0 6px 0 #5e0508, 0 10px 20px rgba(0,0,0,.35);
  text-shadow: 1px 1px 0 rgba(0,0,0,.4);
  transition: transform .1s ease, box-shadow .1s ease, filter .15s ease;
}
.donate:hover { filter: brightness(1.12); }
.donate:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #5e0508, 0 4px 10px rgba(0,0,0,.35);
  border-style: inset;
}

.counter-box {
  margin: 30px auto 0;
  max-width: 470px;
  padding: 14px 12px 18px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-verdana);
}
.counter-head { font-size: 14px; font-weight: 700; }
.counter-row { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--yellow); }
#candleCount { font-family: var(--font-mono); }
.candle-btn {
  position: relative;
  z-index: 10;
  margin-top: 12px;
  cursor: pointer;
  font-family: var(--font-verdana);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  color: var(--black);
  background: linear-gradient(var(--gold-light), var(--gold));
  border: 2px outset #f3e48a;
}
.candle-btn:active { border-style: inset; }

.float-candle {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  font-size: 26px;
  animation: floatUp 1.8s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, 0) scale(.8); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -160px) scale(1.2); }
}

.footer {
  margin-top: 30px;
  font-family: var(--font-verdana);
  font-size: 11px;
  line-height: 1.5;
  color: var(--white);
  text-shadow: var(--shadow-text);
}
.footer p + p { margin-top: 6px; }
.footer a { color: var(--white); position: relative; z-index: 10; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  background: var(--black);
  color: var(--yellow);
  border: 2px solid var(--gold);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .ca-bar { font-size: 12px; gap: 8px; padding: 9px 12px; }
  .ca-value { max-width: 52vw; }
  .page { padding-top: 20px; }
  .story { max-width: 100%; }
  .story .lead { font-size: 15px; }
  .ribbon { width: 20px; height: 36px; }
  .donate { font-size: 20px; padding: 14px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .sparkle, .float-candle { animation: none; }
}
