/* © 2026 Eaglercraft Ranked. All rights reserved. Unauthorized copying or redistribution is prohibited. */
/* Ultimate Expansion Fundraiser (fundraiser.js): the XP style bar, its buttons and the What's This? popup */
.fund {
  --px: 3px; /* one pixel of the game's 182x5 XP bar */
  --fund-gold: #ffcf4d;
  --fund-gold-dark: #6b4a00;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 6px auto 22px;
  max-width: 100%;
}
.fund[hidden] { display: none; }
.fund-title {
  margin: 0;
  font-family: "Minecraft", "Plus Jakarta Sans", monospace;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--fund-gold);
  text-shadow: 2px 2px 0 var(--fund-gold-dark);
  text-align: center;
  text-wrap: balance;
}

/* -- the bar: 182 x 5 game pixels, the amount sitting on top of it like the level does */
.fund-xp {
  --px: 3px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(var(--px) * 182);
  max-width: 100%;
}
.fund-xp-level {
  position: relative;
  z-index: 1;
  margin-bottom: calc(var(--px) * -1);
  font-family: "Minecraft", "Plus Jakarta Sans", monospace;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #ffd84a;
  font-variant-numeric: tabular-nums;
  /* the game's level number: a dark outline all round */
  text-shadow: 2px 0 0 #1a1203, -2px 0 0 #1a1203, 0 2px 0 #1a1203, 0 -2px 0 #1a1203,
    2px 2px 0 #1a1203, -2px -2px 0 #1a1203, 2px -2px 0 #1a1203, -2px 2px 0 #1a1203;
}
.fund-xp-track {
  display: block;
  width: 100%;
  padding: var(--px);
  background: #120d03;
  box-sizing: border-box;
}
.fund-xp-inner {
  position: relative;
  display: block;
  height: calc(var(--px) * 3);
  overflow: hidden;
  /* dark grey-gold where it isn't filled: three pixel rows, light to dark */
  background: linear-gradient(to bottom, #574a28 0 33.34%, #43391e 33.34% 66.67%, #332b15 66.67% 100%);
}
.fund-xp-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(to bottom, #ffeb8f 0 33.34%, #f6c21f 33.34% 66.67%, #bf8a0f 66.67% 100%);
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* the segment marks every 10 game pixels, over the fill too */
.fund-xp-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, transparent calc(var(--px) * 9), rgba(18, 13, 3, 0.75) calc(var(--px) * 9));
  background-size: calc(var(--px) * 10) 100%;
  background-position: calc(var(--px) * -0) 0;
  pointer-events: none;
}

/* -- buttons: the site's pixel bevel */
.fund-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.fund-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 10px 18px 8px;
  font-family: "Minecraft", "Plus Jakarta Sans", monospace;
  font-size: 1.02rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: filter 0.15s ease, transform 0.08s ease;
}
.fund-btn:hover { filter: brightness(1.1); }
.fund-btn:active { transform: translateY(2px); }
.fund-btn:focus-visible { outline: 2px solid var(--fund-gold, #ffcf4d); outline-offset: 2px; }
.fund-donate {
  background: #3c9a2f;
  color: #ffffff;
  text-shadow: 2px 2px 0 #173f12;
  border: 2px solid #173f12;
  box-shadow: inset -3px -3px 0 #2a7421, inset 3px 3px 0 #74d062;
}
/* a light sweeping across Donate now and then */
.fund-donate::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: skewX(-18deg);
  animation: fund-shine 3.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes fund-shine {
  0%, 55% { left: -60%; }
  85%, 100% { left: 130%; }
}
.fund-what {
  background: #2a2a2a;
  color: #d9d6cf;
  text-shadow: 2px 2px 0 #000;
  border: 2px solid #101010;
  box-shadow: inset -3px -3px 0 #1a1a1a, inset 3px 3px 0 #4a4a4a;
}

/* -- the popup */
.fund-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  overflow-y: auto;
}
.fund-overlay[hidden] { display: none; }
html.fund-open { overflow: hidden; }
.fund-modal {
  --px: 3px;
  --fund-gold: #ffcf4d;
  --fund-gold-dark: #6b4a00;
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: auto;
  padding: 30px 30px 26px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0e0b05;
  border: 3px solid #6b4a00;
  box-shadow: inset -4px -4px 0 #050402, inset 4px 4px 0 #2a2108, 0 18px 50px rgba(0, 0, 0, 0.7);
  color: #f5f2ec;
}
.fund-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 0;
  color: #8f8a7e;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.fund-close:hover, .fund-close:focus-visible { color: #f5f2ec; outline: none; }
.fund-modal-title {
  margin: 6px 24px 22px;
  font-family: "Minecraft", "Plus Jakarta Sans", monospace;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--fund-gold);
  text-shadow: 4px 4px 0 var(--fund-gold-dark);
  text-align: center;
  text-wrap: balance;
}
.fund-modal .fund-xp-level { font-size: 1.3rem; }
.fund-lead {
  align-self: stretch;
  margin: 24px 0 12px;
  color: #c9c3b6;
  font-size: 0.95rem;
}
.fund-goals { align-self: stretch; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: fund; }
.fund-goal {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px 12px 58px;
  background: #15110a;
  border: 2px solid #2a2111;
  counter-increment: fund;
}
/* a gold item slot with the number in it */
.fund-goal::before {
  content: counter(fund);
  position: absolute;
  left: 12px;
  top: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Minecraft", "Plus Jakarta Sans", monospace;
  font-size: 1.05rem;
  color: #ffd84a;
  text-shadow: 2px 2px 0 #3d2a00;
  background: #241b09;
  box-shadow: inset -2px -2px 0 #4a3a14, inset 2px 2px 0 #0b0803;
}
.fund-goal-name {
  font-family: "Minecraft", "Plus Jakarta Sans", monospace;
  font-weight: 400;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  color: #ffe08a;
}
.fund-goal-text { color: #bdb7aa; font-size: 0.92rem; line-height: 1.45; }
.fund-why {
  align-self: stretch;
  margin: 18px 0 22px;
  padding-top: 16px;
  border-top: 2px solid #221b0d;
  color: #9e988b;
  font-size: 0.88rem;
  line-height: 1.55;
}
.fund-heart-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.fund-donate-big { min-width: 190px; padding: 13px 26px 11px; font-size: 1.2rem; }
.fund-hearts { display: inline-flex; gap: 4px; }
/* the game's health heart (container + full), 9 pixels at 3x, hopping one after another like regeneration */
.fund-heart {
  width: 27px;
  height: 27px;
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABASURBVChTY2BAgP9QjM6Gg///hYXBGJ2NquDECbgkMoYpxJDAqmg3FkkQBomjWImuEF0BhkJcCmCAoAIYwFAAALujXEPsWruXAAAAAElFTkSuQmCC") 0 0 / 27px 27px no-repeat;
  image-rendering: pixelated;
  animation: fund-hop 2.6s steps(1, end) infinite;
}
.fund-hearts .fund-heart:nth-child(2) { animation-delay: 0.12s; }
.fund-hearts .fund-heart:nth-child(3) { animation-delay: 0.24s; }
.fund-hearts + .fund-donate + .fund-hearts .fund-heart:nth-child(1) { animation-delay: 0.36s; }
.fund-hearts + .fund-donate + .fund-hearts .fund-heart:nth-child(2) { animation-delay: 0.48s; }
.fund-hearts + .fund-donate + .fund-hearts .fund-heart:nth-child(3) { animation-delay: 0.6s; }
@keyframes fund-hop {
  0%, 8% { transform: translateY(-3px); }
  8.01%, 100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .fund-donate::after, .fund-heart { animation: none; }
  .fund-xp-fill { transition: none; }
}
@media (max-width: 560px) {
  .fund, .fund-xp, .fund-modal { --px: 2px; }
  .fund-title { font-size: 1.12rem; }
  .fund-modal { padding: 20px 14px 18px; }
  .fund-modal-title { font-size: 1.45rem; margin: 4px 22px 14px; text-shadow: 3px 3px 0 var(--fund-gold-dark); }
  .fund-lead { margin: 16px 0 8px; font-size: 0.88rem; }
  .fund-goals { gap: 7px; }
  .fund-goal { padding: 8px 10px 8px 48px; gap: 1px; }
  .fund-goal::before { left: 9px; width: 28px; height: 28px; margin-top: -14px; font-size: 0.95rem; }
  .fund-goal-name { font-size: 0.95rem; }
  .fund-goal-text { font-size: 0.84rem; line-height: 1.38; }
  .fund-why { margin: 12px 0 14px; padding-top: 12px; font-size: 0.82rem; line-height: 1.45; }
  .fund-heart-row { gap: 8px; }
  .fund-hearts { gap: 2px; }
  .fund-heart { width: 18px; height: 18px; background-size: 18px 18px; }
  .fund-donate-big { min-width: 0; padding: 12px 18px 10px; }
}
@media (max-width: 379px) {
  .fund, .fund-xp, .fund-modal { --px: 1.5px; }
}
@media (max-width: 400px) {
  .fund-btn { min-width: 0; flex: 1 1 0; }
  .fund-actions { align-self: stretch; }
  .fund-hearts .fund-heart:nth-child(3) { display: none; }
}
