/* Team side: playful, matched to the presentation deck. */
:root {
  --cream: #fff8ee;
  --ink: #111111;
  --muted: #3d3a36;
  --pink: #ffb3de;
  --yellow: #faefa0;
  --sun: #ffe45c;
  --green: #8fe39a;
  --teal: #a7e6dc;
  --orange: #ffc27a;
  --lime: #d6f58c;
  --red: #ffc6c6;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--ink);
  --display: "Fraunces Hunt", "Cooper Black", Georgia, serif;
  --body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.team {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
}

.team-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  max-width: 560px; margin: 0 auto; padding: 12px 16px 4px;
}
.brand { font-family: var(--display); font-weight: 900; font-size: 1.05rem; line-height: 1.2; }
.team-chip {
  padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff;
  font-weight: 700; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%;
}

.team-main { max-width: 560px; margin: 0 auto; padding: 10px 16px 32px; }
.team-main.has-nav { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

.display { font-family: var(--display); font-weight: 900; line-height: 1.08; letter-spacing: -0.01em; }
.display-xl { font-size: clamp(2.6rem, 12vw, 3.4rem); }
h1.display { font-size: clamp(1.9rem, 8.5vw, 2.5rem); }
.page-title { margin-top: 6px; }
h2 { font-size: 1.2rem; font-weight: 700; }
.lede { font-size: 1.05rem; }
.muted { color: var(--muted); font-size: 0.95rem; }
.eyebrow { margin: 0 0 2px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }

/* ---- Cards ---- */
.card {
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin: 0 0 18px;
}
.card-yellow { background: var(--yellow); }
.card-teal { background: var(--teal); }
.card-orange { background: var(--orange); }
.card-cream { background: var(--cream); }
.hero { text-align: left; }
.join-hero { text-align: center; }

.pill {
  display: inline-block; margin: 0 0 12px; padding: 5px 14px; background: #fff;
  border: 2.5px solid var(--ink); border-radius: 12px; font-weight: 700; font-size: 0.95rem;
}
.pill-green { background: var(--green); text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.8rem; }

.token-row { display: flex; align-items: center; gap: 12px; }
.token-row p { margin: 0; }
.token-img { flex: none; width: 56px; height: 56px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 20px; border: 3px solid var(--ink); border-radius: 14px;
  background: #fff; color: var(--ink); font-weight: 700; font-size: 1.05rem; text-decoration: none;
  box-shadow: var(--shadow); cursor: pointer; text-align: center; line-height: 1.2;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--sun); }
.btn-secondary { background: #fff; }
.btn-block { display: flex; width: 100%; margin: 0 0 14px; }
.btn-big { min-height: 64px; font-size: 1.2rem; }
.btn-small { min-height: 48px; padding: 6px 14px; font-size: 0.95rem; box-shadow: 3px 3px 0 var(--ink); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.btn-link {
  background: none; border: 0; padding: 8px 4px; min-height: 48px; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; font-weight: 700; cursor: pointer;
}
.icon { width: 24px; height: 24px; flex: none; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 30px; height: 30px; }

/* ---- Join ---- */
.join-form { display: grid; gap: 10px; }
.field-label { font-weight: 700; }
.join-form input {
  width: 100%; min-height: 56px; padding: 10px 14px; font-size: 1.2rem; letter-spacing: 0.02em;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--cream);
}
.join-form input[aria-invalid="true"] { border-color: #b00020; }
.join-form .btn { margin: 6px 0 0; }
.field-error { margin: 0; color: #9b0018; font-weight: 700; }
.privacy-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }

/* ---- Home ---- */
.score-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.score { text-align: center; padding: 8px; border-radius: 12px; background: var(--green); border: 2.5px solid var(--ink); }
.score-provisional { background: #fff; border-style: dashed; }
.score-num { margin: 0; font-family: var(--display); font-weight: 900; font-size: 2.4rem; line-height: 1.1; }
.score-label { margin: 0; font-size: 0.9rem; font-weight: 600; }

progress.bar {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px;
  border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden;
}
progress.bar::-webkit-progress-bar { background: #fff; border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--green); border-right: 2.5px solid var(--ink); }
progress.bar::-moz-progress-bar { background: var(--green); }
.progress-text { margin: 8px 0 0; font-weight: 600; }

.notice {
  padding: 14px 16px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-weight: 600;
  margin: 0 0 16px;
}
.notice-closed { background: var(--orange); }
.notice-done { background: var(--green); }
.notice-error { background: var(--red); }
.notice p { margin: 0; }

.leave { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 18px; font-size: 0.95rem; }

/* ---- Quests list ---- */
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.quest-tile {
  display: grid; gap: 4px; padding: 16px; min-height: 96px; color: var(--ink); text-decoration: none;
  border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
}
.quest-tile:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.quest-num { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.quest-tile-title { font-family: var(--display); font-weight: 900; font-size: 1.35rem; line-height: 1.15; }
.quest-meta { font-size: 0.9rem; font-weight: 600; }
.q-0 { background: var(--pink); }
.q-1 { background: var(--yellow); }
.q-2 { background: var(--green); }
.q-3 { background: var(--teal); }
.q-4 { background: var(--orange); }
.q-5 { background: var(--lime); }

.badge {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0;
  padding: 3px 12px 3px 8px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff;
  font-weight: 700; font-size: 0.9rem;
}
.badge-pending { background: var(--sun); }
.badge-approved, .badge-partial { background: #fff; }
.badge-approved .icon, .badge-partial .icon { color: #0b6b1e; }
.badge-rejected { background: var(--red); }
.badge-lg { font-size: 1.25rem; padding: 6px 16px 6px 10px; }

/* ---- Quest ---- */
.quest-hero {
  position: relative; padding: 22px 18px 20px; margin: 0 0 18px; text-align: center;
  border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
}
.quest-riddle { margin: 0 0 8px; }
.quest-name { margin: 0; font-weight: 700; }
.reminder-line { font-weight: 700; }
.clue-card { margin: 0 0 18px; }
.clue-card.card { padding: 14px; }
.clue-card h2 { display: flex; align-items: center; gap: 8px; }
.clue-card .btn { margin: 0; }
.clue-text { font-size: 1.1rem; }
.file-input {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.file-input:focus-visible + label { outline: 3px solid #1f3cff; outline-offset: 3px; }
.btn-camera { margin-bottom: 0; }
.preview-img {
  display: block; width: 100%; max-height: 56vh; object-fit: contain; background: #222;
  border: 3px solid var(--ink); border-radius: 12px;
}
.status-line { font-weight: 700; text-align: center; }
.status-card .btn { margin: 12px 0 0; }

/* ---- Receipt ---- */
.receipt-card { text-align: center; }
.receipt-card.status-pending { background: var(--yellow); }
.receipt-card.status-approved, .receipt-card.status-partial { background: var(--green); }
.receipt-card.status-rejected { background: #fff; }
.receipt-title { margin: 0 0 12px; font-size: 1rem; }
.celebrate-title { font-size: 3rem; margin: 0 0 8px; }
.receipt-facts { display: grid; gap: 6px; margin: 0 0 14px; text-align: left; }
.receipt-facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px dashed rgba(0,0,0,0.35); padding: 4px 0; }
.receipt-facts dt { font-weight: 700; }
.receipt-facts dd { margin: 0; text-align: right; }
.receipt-card .notice { text-align: left; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti span {
  position: absolute; top: -24px; width: 12px; height: 18px; border: 2px solid var(--ink); border-radius: 3px;
  background: var(--pink); animation: confetti-fall 2.6s cubic-bezier(.3,.6,.5,1) forwards;
}
.confetti span:nth-child(6n+1) { background: var(--sun); }
.confetti span:nth-child(6n+2) { background: var(--green); border-radius: 50%; width: 14px; height: 14px; }
.confetti span:nth-child(6n+3) { background: var(--teal); }
.confetti span:nth-child(6n+4) { background: var(--orange); border-radius: 50%; width: 12px; height: 12px; }
.confetti span:nth-child(6n+5) { background: var(--lime); }
.confetti span:nth-child(1) { left: 4%; animation-delay: 0s; }
.confetti span:nth-child(2) { left: 9%; animation-delay: .3s; }
.confetti span:nth-child(3) { left: 14%; animation-delay: .1s; }
.confetti span:nth-child(4) { left: 19%; animation-delay: .5s; }
.confetti span:nth-child(5) { left: 24%; animation-delay: .2s; }
.confetti span:nth-child(6) { left: 29%; animation-delay: .6s; }
.confetti span:nth-child(7) { left: 34%; animation-delay: .15s; }
.confetti span:nth-child(8) { left: 39%; animation-delay: .45s; }
.confetti span:nth-child(9) { left: 44%; animation-delay: .05s; }
.confetti span:nth-child(10) { left: 49%; animation-delay: .35s; }
.confetti span:nth-child(11) { left: 54%; animation-delay: .25s; }
.confetti span:nth-child(12) { left: 59%; animation-delay: .55s; }
.confetti span:nth-child(13) { left: 64%; animation-delay: .1s; }
.confetti span:nth-child(14) { left: 69%; animation-delay: .4s; }
.confetti span:nth-child(15) { left: 74%; animation-delay: .2s; }
.confetti span:nth-child(16) { left: 79%; animation-delay: .65s; }
.confetti span:nth-child(17) { left: 84%; animation-delay: 0s; }
.confetti span:nth-child(18) { left: 89%; animation-delay: .3s; }
.confetti span:nth-child(19) { left: 94%; animation-delay: .5s; }
.confetti span:nth-child(20) { left: 12%; animation-delay: .7s; }
.confetti span:nth-child(21) { left: 37%; animation-delay: .8s; }
.confetti span:nth-child(22) { left: 57%; animation-delay: .75s; }
.confetti span:nth-child(23) { left: 77%; animation-delay: .9s; }
.confetti span:nth-child(24) { left: 97%; animation-delay: .6s; }
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .btn, .quest-tile { transition: none; }
}

/* ---- Board ---- */
.board-caption { font-weight: 600; }
.board-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.board-list.unranked { grid-template-columns: 1fr 1fr; }
.board-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
  background: var(--cream); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow);
  font-weight: 600;
}
.board-list.unranked .board-row { justify-content: center; text-align: center; }
.board-row.is-you { background: var(--sun); }
.board-rank {
  flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: #fff; font-weight: 800;
}
.board-name { flex: 1; }
.board-points { font-weight: 800; white-space: nowrap; }
.board-updated { font-size: 0.85rem; }
body.team .board { padding: 4px 0; }
.empty { padding: 18px; text-align: center; border: 3px dashed var(--ink); border-radius: 14px; background: #fff; }

/* ---- Bottom nav ---- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 3px solid var(--ink);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; margin: 0 4px; border-radius: 14px; color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 0.85rem;
}
.bottom-nav a[aria-current="page"] { background: var(--sun); border: 2.5px solid var(--ink); }

.resume-banner {
  max-width: 560px; margin: 6px auto 0; padding: 10px 16px; display: flex; gap: 10px; align-items: center;
  justify-content: space-between; background: var(--orange); border-block: 3px solid var(--ink); font-weight: 600;
}
.resume-banner p { margin: 0; }
.confirm-card .btn { margin-top: 10px; }
.confirm-card form .btn { margin-top: 6px; }
.error-card { background: var(--pink); }
