* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 30% 0%, #fffef9 0%, #f5efe0 100%);
  color: #1c1917;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  padding: 1.5rem 1.25rem 3.5rem;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.top-badge {
  display: inline-block;
  background: #fef08a;
  color: #1c1917;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.8rem;
  border: 2.5px solid #1c1917;
  border-radius: 999px;
  box-shadow: 0 3px 0 #1c1917;
  transform: rotate(-1deg);
}

.account-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.acct-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  border: 2px solid #1c1917;
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1c1917;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 0 #1c1917;
}

.acct-pill:hover {
  background: #fef9c3;
}

.acct-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: #57534e;
}

.signout-btn {
  background: none;
  border: 0;
  padding: 0.2rem 0.35rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #78716c;
  text-decoration: underline;
  cursor: pointer;
}

.signout-btn:hover {
  color: #1c1917;
}

/* Main two-column layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2rem;
  align-items: start;
}

.left-col {
  text-align: center;
}

h1 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: clamp(2.1rem, 4.5vw, 2.85rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 0.65rem;
  letter-spacing: -0.015em;
}

.sub {
  font-size: 1.04rem;
  line-height: 1.5;
  color: #44403c;
  margin: 0 auto 1.2rem;
  max-width: 38ch;
}

/* Interactive Jar */
.jar-area {
  margin-bottom: 1.15rem;
}

.jar-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.14s ease;
}

.jar-btn:hover {
  transform: scale(1.04) rotate(-1.5deg);
}

.jar-btn:active {
  transform: scale(0.96) rotate(2deg);
}

.jar-btn.shake {
  animation: jar-shake 0.38s ease;
}

@keyframes jar-shake {
  0% { transform: rotate(0deg); }
  22% { transform: rotate(-7deg) scale(1.05); }
  52% { transform: rotate(6deg) scale(1.03); }
  78% { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}

.jar-hint {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.9rem;
  color: #78716c;
  margin-top: 0.05rem;
  min-height: 1.3em;
}

/* Goal Card */
.goal-card {
  background: #ffffff;
  border: 3px solid #1c1917;
  border-radius: 18px;
  box-shadow: 0 5px 0 #1c1917;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.15rem;
  text-align: left;
}

.goal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.65rem;
}

.raised-block {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.raised-num {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 2rem;
  line-height: 1;
  color: #16a34a;
}

.raised-sub {
  font-size: 0.86rem;
  color: #57534e;
  font-weight: 600;
}

.goal-block {
  text-align: right;
}

.goal-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #78716c;
}

.goal-num {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.22rem;
  line-height: 1.1;
}

.bar-track {
  height: 22px;
  background: #f2ede2;
  border: 3px solid #1c1917;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    -45deg,
    #22c55e,
    #22c55e 10px,
    #16a34a 10px,
    #16a34a 20px
  );
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.goal-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #57534e;
}

/* Tactile Buttons */
.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-give {
  width: 100%;
  display: block;
  text-decoration: none;
  background: #22c55e;
  color: #ffffff;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  padding: 0.88rem 1.35rem;
  border: 3px solid #1c1917;
  border-radius: 15px;
  box-shadow: 0 5px 0 #15803d, 0 8px 0 #1c1917;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
}

.btn-give:hover {
  background: #16a34a;
  transform: translateY(-1px);
  box-shadow: 0 6px 0 #15803d, 0 9px 0 #1c1917;
}

.btn-give:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #15803d, 0 4px 0 #1c1917;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.15rem;
}

.btn-small {
  background: #ffffff;
  color: #1c1917;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border: 2.5px solid #1c1917;
  border-radius: 13px;
  box-shadow: 0 3px 0 #1c1917;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
}

.btn-small:hover {
  background: #fef9c3;
}

.btn-small:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #1c1917;
}

.msg {
  min-height: 1.4em;
  margin: 0.8rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #57534e;
}

/* Right Column: Live Jar Feed */
.feed-card {
  background: #ffffff;
  border: 3px solid #1c1917;
  border-radius: 20px;
  box-shadow: 0 6px 0 #1c1917;
  padding: 1.25rem;
  text-align: left;
  min-height: 440px;
  max-height: 620px;
  display: flex;
  flex-direction: column;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px dashed #e7e2d5;
}

.feed-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.feed-head h2 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.3rem;
  margin: 0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #16a34a;
  border-radius: 999px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  letter-spacing: 0.04em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.feed-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: #78716c;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  padding-right: 2px;
  flex: 1;
}

.feed-empty {
  margin: auto 0;
  font-size: 0.94rem;
  color: #78716c;
  text-align: center;
  padding: 2rem 1rem;
}

.pledge-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  background: #faf7f0;
  border: 2px solid #e7e2d5;
  border-radius: 13px;
  padding: 0.7rem 0.85rem;
}

.pledge-item.fresh {
  animation: slide-in 0.28s ease-out;
  border-color: #86efac;
  background: #f0fdf4;
}

@keyframes slide-in {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.pledge-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pledge-name {
  font-weight: 700;
  font-size: 0.94rem;
  color: #1c1917;
}

.pledge-count {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fef08a;
  border: 1.5px solid #1c1917;
  border-radius: 999px;
  padding: 0.02rem 0.4rem;
}

.pledge-time {
  font-size: 0.74rem;
  color: #a8a29e;
  font-weight: 600;
}

.pledge-note {
  margin: 0.22rem 0 0;
  font-size: 0.86rem;
  color: #57534e;
  word-break: break-word;
}

.pledge-amt {
  flex-shrink: 0;
  background: #dcfce7;
  color: #15803d;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.2rem 0.6rem;
  border: 2px solid #1c1917;
  border-radius: 999px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.55);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: #fffdf7;
  border: 3px solid #1c1917;
  border-radius: 20px;
  box-shadow: 0 8px 0 #1c1917;
  padding: 1.5rem;
  text-align: left;
  animation: modal-pop 0.18s ease-out;
}

@keyframes modal-pop {
  0% { transform: scale(0.94) translateY(8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #1c1917;
  background: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #fee2e2;
}

.modal-pill {
  display: inline-block;
  background: #fef08a;
  border: 2px solid #1c1917;
  border-radius: 999px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.65rem;
}

.modal-card h2 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.55rem;
  margin: 0 0 0.3rem;
}

.modal-desc {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #57534e;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  text-decoration: none;
  background: #ffffff;
  color: #1c1917;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.8rem 1rem;
  border: 2.5px solid #1c1917;
  border-radius: 13px;
  box-shadow: 0 4px 0 #1c1917;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
}

.google-btn:hover {
  background: #fef9c3;
}

.google-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1c1917;
}

.setup-warn {
  margin: 0.9rem 0 0;
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size: 0.8rem;
  color: #991b1b;
  line-height: 1.4;
}

.field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0.8rem 0 0.35rem;
}

.opt {
  font-weight: 500;
  color: #78716c;
}

.amount-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.amt-pill {
  background: #ffffff;
  border: 2.5px solid #1c1917;
  border-radius: 10px;
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.45rem 0;
  cursor: pointer;
}

.amt-pill.active,
.amt-pill:hover {
  background: #dcfce7;
}

.custom-amt-row {
  position: relative;
}

.dollar-prefix {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #57534e;
}

input[type="number"],
input[type="text"] {
  width: 100%;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  padding: 0.62rem 0.85rem;
  border: 2.5px solid #1c1917;
  border-radius: 11px;
  background: #ffffff;
  color: #1c1917;
  outline: none;
}

input[type="number"] {
  padding-left: 1.75rem;
}

input:disabled {
  background: #f5f5f4;
  color: #78716c;
}

input:focus {
  background: #fefce8;
}

.name-row {
  display: flex;
  gap: 0.45rem;
}

.dice-btn {
  flex-shrink: 0;
  width: 46px;
  border: 2.5px solid #1c1917;
  border-radius: 11px;
  background: #ffffff;
  font-size: 1.15rem;
  cursor: pointer;
}

.dice-btn:hover {
  background: #fef9c3;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #44403c;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #16a34a;
  cursor: pointer;
}

.form-error {
  min-height: 1.2em;
  margin: 0.65rem 0 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #dc2626;
}

.submit-btn {
  margin-top: 0.6rem;
  font-size: 1.2rem;
  padding: 0.8rem 1.2rem;
}

/* Floating pop particle */
.pop {
  position: fixed;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #15803d;
  pointer-events: none;
  z-index: 200;
  animation: pop-up 0.85s ease-out forwards;
}

@keyframes pop-up {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
  .feed-card {
    min-height: 220px;
    max-height: 440px;
  }
}

@media (max-width: 440px) {
  .btn-row {
    grid-template-columns: 1fr;
  }
}
