/* Giver pages of an event. Colours come from :root variables (themecss). */
:root {
  --bg: #f4f4f4; --surface: #fff; --text: #1a1a1a; --muted: #6b6b6b;
  --primary: #111; --primary-text: #fff; --accent: #2f4057; --match: #9a9a9a;
  --font-display: 'Raleway', sans-serif;
  --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; padding-bottom: 84px; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 4px; padding: 12px 18px; background: var(--primary); color: var(--primary-text); font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.9rem; }
button.secondary { background: rgba(0,0,0,0.08); color: var(--text); }
button:disabled { opacity: 0.5; cursor: default; }
input, textarea { font: inherit; width: 100%; padding: 10px 12px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.25); background: #fff; color: #1a1a1a; }
a { color: inherit; }

#connection-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.8); color: #fff; font-family: var(--font-display); font-size: 1.3rem; visibility: hidden; opacity: 0; transition: opacity 0.3s; }
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 110; display: none; padding: 10px 18px; border-radius: 4px; color: #fff; font-size: 0.95rem; transition: opacity 0.3s; max-width: 90vw; text-align: center; }

#hero { text-align: center; padding: 0 0 8px; background: var(--primary); color: var(--primary-text); }
#hero .topbar { font-family: var(--font-display); letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.85rem; padding: 10px 16px; opacity: 0.85; }
#hero h1 { font-size: 2.6rem; line-height: 1; padding: 14px 16px 10px; letter-spacing: 0.04em; text-transform: uppercase; }
#hero-logo { max-height: 70px; max-width: 70%; margin: 14px auto 0; display: block; object-fit: contain; }
#hero-art { margin: 6px auto 0; width: min(92vw, 520px); aspect-ratio: 2.2 / 1; border-radius: 18px; overflow: hidden; background: center / cover no-repeat; }
#hero-art[hidden] { display: none; }
#subtitle { padding: 12px 16px 14px; font-family: var(--font-display); font-size: 1rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.9; }
#hero .lang { position: absolute; right: 10px; top: 8px; font-size: 0.75rem; opacity: 0.7; }

#public-main { max-width: 560px; margin: 0 auto; padding: 8px 14px 24px; }
.card { background: var(--surface); color: var(--text); border-radius: 8px; padding: 16px; margin: 14px 0; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.card h2 { font-size: 1.2rem; color: var(--accent); margin-bottom: 8px; }
.card.primary { background: var(--primary); color: var(--primary-text); }
.card.primary h2 { color: var(--primary-text); }
.card p.intro { font-size: 0.98rem; line-height: 1.45; white-space: pre-line; }

.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 4px; }
.totals .stat.wide { grid-column: 1 / -1; border-top: 1px solid rgba(0,0,0,0.12); padding-top: 12px; }
.stat .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.stat .value { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.15; }
.stat .value.big { font-size: 2.2rem; color: var(--accent); }
.stat .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.fund { margin-top: 12px; }
.fund .label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); }
.fund .track { height: 8px; background: rgba(0,0,0,0.1); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.fund .track > div { height: 100%; background: var(--match); transition: width 0.3s; }

.chart .legend { display: flex; gap: 16px; font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.chart .legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 5px; vertical-align: -2px; }
.chart .legend .lg-pledged::before { background: var(--accent); }
.chart .legend .lg-matched::before { background: var(--match); }
.bar-row { margin: 9px 0; }
.bar-row .bar-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; margin-bottom: 4px; gap: 8px; }
.bar-row .bar-label .name { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-label .sum { font-family: var(--font-display); font-size: 1.05rem; white-space: nowrap; }
.bar-row.mine .bar-label .name::before { content: '\25CF'; color: var(--accent); margin-right: 5px; font-size: 0.7rem; vertical-align: 1px; }
.bar { display: flex; height: 18px; background: rgba(0,0,0,0.08); border-radius: 3px; overflow: hidden; }
.bar.has-target { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.bar .seg { height: 100%; transition: width 0.25s; min-width: 0; }
.bar .seg.pledged { background: var(--accent); border-radius: 3px 0 0 3px; }
.bar .seg.matched { background: var(--match); border-radius: 0 3px 3px 0; margin-left: 2px; }
.bar .seg.pledged.last { border-radius: 3px; }
.bar-row .bar-sub { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

.project { position: relative; }
.project .num { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.project h2 { margin: 2px 0 0; color: var(--text); font-size: 1.4rem; line-height: 1.15; }
.project .tagline { color: var(--accent); font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.project .org { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.project .cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin: 10px 0 4px; display: block; }
.project .more { display: inline-block; margin-top: 8px; font-size: 0.9rem; color: var(--accent); font-weight: 600; }
.project .target { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding: 8px 12px; background: rgba(0,0,0,0.05); border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; }
.project .target .lbl { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.project .target .val { font-family: var(--font-display); font-size: 1.3rem; color: var(--accent); }
.project .committed-badge { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: #2e7d32; margin-top: 6px; }

.pledge { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.12); }
.pledge .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pledge .row .lbl { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.pledge .row .mine-amount { font-family: var(--font-display); font-size: 1.9rem; color: var(--accent); line-height: 1; }
.pledge .row .mine-amount.zero { color: var(--muted); }
.pledge .status { font-size: 0.78rem; color: var(--muted); min-height: 1em; text-align: right; }
.pledge .status.saved { color: #2e7d32; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 6px 0 4px; padding: 0; border: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; background: rgba(0,0,0,0.15); border-radius: 4px; }
input[type=range]::-moz-range-track { height: 8px; background: rgba(0,0,0,0.15); border-radius: 4px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--accent); border: 4px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 4px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.pledge .ticks { position: relative; height: 1em; margin: 0 15px 8px; font-size: 0.72rem; color: var(--muted); }
.pledge .ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.pledge .ticks span:first-child { transform: translateX(-30%); }
.pledge .ticks span:last-child { transform: translateX(-70%); }
.amount-row { display: flex; gap: 8px; align-items: center; }
.amount-row input { flex: 1; width: auto; min-width: 0; font-size: 1.1rem; text-align: right; font-family: var(--font-display); }
.amount-row .unit { color: var(--muted); }
.amount-row button.clear { padding: 10px 12px; font-size: 0.85rem; background: rgba(0,0,0,0.08); color: var(--text); }
.closed-note { text-align: center; padding: 4px 0; font-size: 0.95rem; }

/* identity + commitment */
.identity .code { font-family: monospace; font-size: 1.7rem; letter-spacing: 0.14em; margin: 2px 0 4px; }
.identity .link-box { background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.15); border-radius: 4px; padding: 8px 10px; word-break: break-all; font-family: monospace; font-size: 0.82rem; margin: 8px 0; }
.identity .link-box a { color: var(--accent); }
.identity .lbl { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 12px; }
.identity .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.identity .actions button { padding: 8px 12px; font-size: 0.8rem; }
.identity details { margin-top: 12px; }
.identity summary { cursor: pointer; font-weight: 600; }
.identity .adopt { display: flex; gap: 8px; margin-top: 8px; }
.identity .adopt input { flex: 1; text-transform: uppercase; font-family: monospace; letter-spacing: 0.1em; }
.commit .fields label { display: block; font-size: 0.8rem; color: var(--muted); margin: 10px 0 4px; }
.commit .actions { margin-top: 12px; }
.commit .done { color: #2e7d32; font-weight: 600; }
.commit .warn { color: #b26a00; font-size: 0.9rem; }

#my-total { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--primary); color: var(--primary-text); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 -2px 10px rgba(0,0,0,0.25); }
#my-total .lbl { font-family: var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; line-height: 1.1; }
#my-total .sub { font-size: 0.7rem; opacity: 0.85; margin-top: 2px; }
#my-total .val { font-family: var(--font-display); font-size: 1.7rem; line-height: 1; white-space: nowrap; }
#my-total a { color: inherit; }

#public-footer { text-align: center; padding: 22px 16px 30px; color: var(--muted); font-size: 0.85rem; }
#public-footer img { height: 28px; opacity: 0.8; display: block; margin: 0 auto 8px; }
