:root {
  --bg: #f4f6f1;
  --panel: #ffffff;
  --ink: #1c2421;
  --muted: #6d746f;
  --accent: #7247e8;
  --accent-dark: #5733bd;
  --line: rgba(28, 36, 33, 0.12);
  --shadow: 0 28px 80px rgba(35, 46, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-width: 320px;
  background: var(--bg);
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(114, 71, 232, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(28, 132, 112, 0.16), transparent 36%),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  height: 100%;
  line-height: 1.5;
  overflow: hidden;
  text-rendering: optimizeLegibility;
}

.page-shell {
  display: grid;
  height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: clamp(10px, 2svh, 20px) 14px;
}

.donation {
  width: min(100%, 680px);
  max-height: calc(100svh - clamp(20px, 4svh, 20px));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  padding: clamp(14px, 3svh, 26px) clamp(16px, 5vw, 34px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(18px);
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 460px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.35;
}

.lead span {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.youmoney-widget {
  --widget-scale: 1;
  --widget-width-scale: 1;
  --widget-shift: clamp(7px, 2.4vw, 12px);

  display: flex;
  width: min(100%, 500px);
  height: calc(480px * var(--widget-scale));
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  margin: clamp(10px, 2svh, 18px) auto 0;
}

.youmoney-widget form,
.youmoney-widget iframe,
.youmoney-widget button,
.youmoney-widget input[type="submit"],
.youmoney-widget a {
  max-width: 100%;
}

.youmoney-widget iframe {
  flex: 0 0 auto;
  display: block;
  position: relative;
  left: var(--widget-shift);
  width: min(calc(100% * var(--widget-width-scale)), calc(500px * var(--widget-width-scale)));
  max-width: none;
  height: 480px;
  margin-inline: auto;
  border: 0;
  transform: scale(var(--widget-scale));
  transform-origin: top center;
}

.button-placeholder {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 24px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(122, 77, 243, 0.25);
}

.button-placeholder:hover {
  background: var(--accent-dark);
}

@media (max-width: 420px) {
  .page-shell {
    align-items: stretch;
    padding: 10px;
  }

  .donation {
    display: grid;
    max-height: calc(100svh - 20px);
    align-content: center;
  }
}

@media (max-height: 760px) {
  .youmoney-widget {
    --widget-scale: 0.92;
    --widget-width-scale: 1.087;
  }
}

@media (max-height: 690px) {
  .kicker {
    margin-bottom: 4px;
  }

  h1 {
    font-size: clamp(1.72rem, 7vw, 2.35rem);
  }

  .lead {
    margin-top: 8px;
    font-size: 0.9rem;
  }

  .lead span {
    margin-top: 2px;
    font-size: 0.8rem;
  }

  .youmoney-widget {
    --widget-scale: 0.84;
    --widget-width-scale: 1.19;
  }
}

@media (max-height: 610px) {
  .page-shell {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .donation {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .youmoney-widget {
    --widget-scale: 0.76;
    --widget-width-scale: 1.316;
    margin-top: 8px;
  }
}

@media (max-height: 560px) {
  .kicker,
  .lead span {
    display: none;
  }

  .lead {
    margin-top: 6px;
  }

  .youmoney-widget {
    --widget-scale: 0.68;
    --widget-width-scale: 1.471;
  }
}

@media (max-width: 420px) and (max-height: 610px) {
  .kicker,
  .lead {
    display: none;
  }

  h1 {
    font-size: 1.55rem;
  }

  .youmoney-widget {
    --widget-scale: 0.88;
    --widget-width-scale: 1.136;
    margin-top: 10px;
  }
}
