/* =====================================================================
   Save The Garden $1,000 Challenge — shared styles
   Change the look by editing the variables below.
   ===================================================================== */
:root {
  --primary: #2f6b3a;          /* main green: buttons, bar */
  --primary-dark: #22502b;
  --secondary: #e8a33d;        /* accent: goal reached, highlights */
  --background: #f4f6f3;
  --card: #ffffff;
  --text: #1d2a1f;
  --muted: #5b665d;
  --border: #dde3dc;
  --success: #1f8f4e;
  --danger: #b3261e;
  --radius: 14px;
  --max-width: 560px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 20px 16px 40px; }

.brand {
  text-align: center;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 13px;
  color: var(--primary);
  margin: 8px 0 16px;
  line-height: 1.5;
}
.brand a { color: inherit; text-decoration: none; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 24px rgba(0,0,0,.05);
  text-align: center;
}

.team-name {
  font-size: clamp(28px, 8vw, 40px);
  font-weight: 900;
  line-height: 1.1;
  margin: 4px 0 6px;
  text-transform: uppercase;
  word-break: break-word;
}
.leader { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

.raised { font-size: clamp(34px, 11vw, 48px); font-weight: 900; line-height: 1; margin: 0; }
.of-goal { color: var(--muted); margin: 6px 0 14px; font-size: 16px; }

.bar {
  height: 22px;
  background: #e6ebe5;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 10px;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #4c9a59);
  border-radius: 999px;
  transition: width 1s ease-out;
}
.goal-reached .bar-fill { background: linear-gradient(90deg, var(--success), var(--secondary)); }

.to-go { font-weight: 800; font-size: 18px; margin: 0 0 22px; }
.celebrate {
  display: none;
  background: #fff6e6;
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 0 18px;
  font-weight: 800;
  font-size: 18px;
}
.goal-reached .celebrate { display: block; }

/* Short explanation above the team card */
.about {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 24px rgba(0,0,0,.05);
}
.about-img { display: block; width: 100%; height: auto; }
.about p { margin: 0; padding: 0 18px 14px; font-size: 16px; }
.about .about-lead { padding-top: 16px; font-size: 17px; }

/* Buttons: big tap targets for phones */
.btn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .5px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn + .btn { margin-top: 12px; }
.btn:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }

.share-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.share-row a, .share-row button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.link-box {
  margin: 18px 0 0;
  padding: 12px;
  background: var(--background);
  border-radius: 10px;
  font-size: 15px;
  word-break: break-all;
}

.qr-toggle { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 700; margin-top: 16px; cursor: pointer; min-height: 44px; }
.qr { display: none; margin: 10px auto 0; width: 200px; }
.qr.show { display: block; }
.qr img, .qr canvas { width: 200px !important; height: 200px !important; }

.note { color: var(--muted); font-size: 13px; margin-top: 18px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; }
.footer a { color: inherit; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }

.center-msg { text-align: center; padding: 40px 10px; }
.loading { color: var(--muted); }
[hidden] { display: none !important; }
