:root {
  --bg: #07120b;
  --bg-2: #0c1d10;
  --neon: #39ff14;
  --neon-soft: #93ff7f;
  --ink: #031106;
  --white: #f8fff4;
  --panel: rgba(12, 31, 17, 0.9);
  --line: rgba(57, 255, 20, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Chakra Petch", system-ui, sans-serif;
  background: radial-gradient(circle at 10% 10%, #143e1f 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, #1e3f24 0%, transparent 40%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--white);
  overflow-x: hidden;
}

.bg-words {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  opacity: 0.12;
}

.bg-track {
  font-family: "Teko", sans-serif;
  font-size: clamp(62px, 20vw, 188px);
  letter-spacing: 0.03em;
  color: var(--neon);
  line-height: 0.9;
  white-space: nowrap;
  text-shadow: 0 0 14px rgba(57, 255, 20, 0.25);
  -webkit-text-stroke: 1px rgba(15, 62, 24, 0.7);
  transform: translateX(-2%);
  animation: marquee 16s linear infinite;
}

.bg-track:nth-child(2n) {
  color: #84ff66;
  -webkit-text-stroke: 1px rgba(8, 35, 15, 0.7);
  animation-direction: reverse;
  animation-duration: 14s;
}

.bg-track:nth-child(3n) {
  color: #39ff14;
  text-shadow: 0 0 24px rgba(57, 255, 20, 0.42);
}

.page {
  position: relative;
  z-index: 2;
  width: min(1000px, 100% - 14px);
  margin: 10px auto 18px;
  display: grid;
  gap: 12px;
  align-items: start;
}

.party-cta {
  position: sticky;
  top: 8px;
  justify-self: end;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.party-hint {
  font: 700 14px/1 "Chakra Petch", sans-serif;
  color: #d6ffcf;
  background: rgba(3, 21, 8, 0.92);
  border: 1px solid rgba(57, 255, 20, 0.55);
  border-radius: 999px;
  padding: 6px 9px;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.25);
  animation: hintTap 1s ease-in-out infinite;
}

.party-fab {
  border: 1px solid rgba(57, 255, 20, 0.75);
  border-radius: 999px;
  padding: 8px 14px;
  color: #031507;
  background: linear-gradient(180deg, #7dff61, #39ff14);
  font: 700 18px/1 "Teko", sans-serif;
  letter-spacing: 0.03em;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.4);
}

.poster {
  display: grid;
  gap: 10px;
  align-items: start;
}

.photo-polaroid {
  background: #f5ffe8;
  padding: 10px 10px 26px;
  border-radius: 4px;
  transform: rotate(-1.2deg);
  min-height: 390px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(57, 255, 20, 0.25);
  position: relative;
  overflow: hidden;
}

.photo-polaroid img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-rain {
  position: absolute;
  inset: 10px 10px 26px;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.rain-icon {
  position: absolute;
  top: -28px;
  font-size: 20px;
  opacity: 0;
  animation: iconRain 1.45s ease-in forwards;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-size: 58px;
  color: #0e2a12;
}

.intro-card,
.gift-block,
.donation-card,
.footer-msg {
  background: linear-gradient(180deg, rgba(10, 30, 16, 0.95), rgba(6, 20, 11, 0.96));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.15) inset, 0 14px 30px rgba(0, 0, 0, 0.35);
}

.intro-card,
.gift-block,
.donation-card,
.footer-msg {
  padding: 12px;
}

.intro-card {
  display: grid;
  gap: 6px;
}

.badge {
  margin: 0 0 2px;
  color: var(--neon-soft);
  font: 700 clamp(16px, 4.8vw, 28px) / 0.95 "Teko", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  display: grid;
  font-family: "Teko", sans-serif;
  font-weight: 700;
  font-size: clamp(64px, 21vw, 168px);
  line-height: 0.72;
  letter-spacing: 0.02em;
  color: var(--neon);
  text-shadow: 0 0 18px rgba(57, 255, 20, 0.52);
  animation: flicker 2.2s linear infinite;
}

h1 span {
  display: block;
}

h1 span:last-child {
  margin-top: -0.07em;
}

.name {
  margin: 2px 0 0;
  font: 700 clamp(30px, 9vw, 54px) / 0.95 "Teko", sans-serif;
  letter-spacing: 0.02em;
  color: #e6ffe0;
}

.lead {
  margin: 4px 0 0;
  font-size: clamp(18px, 4.9vw, 30px);
  line-height: 1.12;
  color: #daf9d3;
}

.progress-card {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(57, 255, 20, 0.28);
  border-radius: 10px;
  background: rgba(8, 23, 12, 0.9);
}

.progress-card p {
  margin: 0 0 8px;
}

.progress-track {
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(57, 255, 20, 0.45);
  background: #08180c;
  padding: 2px;
}

.progress-fill {
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #29ff88, #b0ff63);
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.56);
  animation: nudge 1.5s ease-in-out infinite;
}

.live-counter {
  color: #88ff7b;
  font-weight: 700;
}

.cheer {
  color: #c8ffbe;
  font-weight: 700;
  min-height: 20px;
}

.gift-block h2,
.donation-title {
  margin: 0 0 8px;
  font: 700 clamp(44px, 12vw, 78px) / 0.82 "Teko", sans-serif;
  letter-spacing: 0.03em;
  color: var(--neon);
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.35);
}

.gift-grid {
  display: grid;
  gap: 10px;
}

.gift-card {
  border: 1px solid rgba(57, 255, 20, 0.28);
  border-radius: 10px;
  padding: 12px;
  background: rgba(4, 18, 8, 0.8);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cardBob 1.8s ease-in-out infinite;
}

.gift-card:nth-child(2n) {
  animation-delay: 0.2s;
}

.gift-card p {
  margin: 0;
  font-size: clamp(19px, 5.2vw, 29px);
  line-height: 1.08;
  font-weight: 700;
  color: #f1ffe9;
}

.gift-card span {
  align-self: flex-start;
  font: 700 clamp(16px, 4.4vw, 24px) / 1 "Teko", sans-serif;
  letter-spacing: 0.04em;
  color: #03210b;
  background: var(--neon);
  border-radius: 999px;
  padding: 5px 10px;
}

.donation-card {
  position: relative;
  overflow: hidden;
}

.donation-card::before {
  content: "";
  position: absolute;
  inset: -130%;
  background: conic-gradient(from 0deg, rgba(57, 255, 20, 0.2), rgba(62, 255, 184, 0.16), rgba(176, 255, 99, 0.2), rgba(57, 255, 20, 0.2));
  animation: spin 7s linear infinite;
}

.donation-card > * {
  position: relative;
  z-index: 1;
}

.qr {
  margin-top: 6px;
  width: min(100%, 190px);
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

.alias-label {
  margin: 8px 0 2px;
  font-size: 12px;
  color: #b6ffae;
  text-transform: uppercase;
}

.alias {
  margin: 0;
  font: 700 clamp(42px, 14vw, 72px) / 0.92 "Teko", sans-serif;
  letter-spacing: 0.03em;
  text-shadow: 0 0 14px rgba(57, 255, 20, 0.28);
}

.alias-owner {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.2;
  color: #c7efc0;
  opacity: 0.9;
}

.actions {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.copy-btn {
  width: 100%;
  border: 1px solid rgba(57, 255, 20, 0.5);
  border-radius: 10px;
  padding: 10px;
  color: #031507;
  font: 700 16px/1 "Teko", sans-serif;
  letter-spacing: 0.03em;
}

.copy-btn {
  background: #93ff7f;
}

.copy-btn:hover,
.party-fab:hover {
  filter: brightness(1.08);
}

.copy-btn.copy-pop {
  animation: copyPop 280ms ease-out;
}

.copy-feedback {
  min-height: 18px;
  margin: 6px 0 0;
  color: #9effa1;
  font-weight: 700;
}

.note {
  margin: 4px 0 0;
  color: #d9ffd2;
}

.footer-msg {
  text-align: center;
}

.footer-msg p {
  margin: 0;
  font: 700 clamp(22px, 7vw, 34px) / 1 "Teko", sans-serif;
  letter-spacing: 0.02em;
  color: var(--neon);
}

.party-burst {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.burst-item {
  position: absolute;
  top: 58%;
  left: 50%;
  font-size: 18px;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: burst 820ms ease-out forwards;
}

@keyframes marquee {
  100% {
    transform: translateX(-24%);
  }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  48% { opacity: 0.95; }
  50% { opacity: 0.8; }
  52% { opacity: 0.98; }
}

@keyframes nudge {
  0%,100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

@keyframes cardBob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -120px))) scale(1.2); }
}

@keyframes hintTap {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px) scale(1.03); }
}

@keyframes copyPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes iconRain {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg) scale(0.8);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0.95;
    transform: translateY(var(--fall, 420px)) rotate(var(--spin, 30deg)) scale(1.05);
  }
}

@media (min-width: 900px) {
  .page {
    width: min(1080px, 100% - 24px);
    margin-top: 16px;
  }

  .poster {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 14px;
  }

  .photo-polaroid {
    min-height: 520px;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(92px, 11vw, 172px);
    line-height: 0.74;
  }

  .lead {
    font-size: clamp(22px, 2.3vw, 32px);
  }
}

body.party-mode .page {
  animation: pageShake 620ms ease-in-out;
}

@keyframes pageShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-8px) rotate(-0.5deg) scale(1.004); }
  20% { transform: translateX(8px) rotate(0.5deg); }
  30% { transform: translateX(-7px) rotate(-0.4deg); }
  40% { transform: translateX(7px) rotate(0.4deg); }
  50% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  90% { transform: translateX(-2px); }
}

@media (max-width: 560px) {
  .page {
    width: min(1000px, 100% - 10px);
  }

  .party-hint {
    font-size: 12px;
    padding: 5px 8px;
  }

  h1 {
    font-size: clamp(58px, 20vw, 118px);
    line-height: 0.75;
  }

  .lead {
    font-size: clamp(18px, 5.3vw, 24px);
  }

  .gift-card p {
    font-size: clamp(20px, 6vw, 26px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
