/* BumpBash — shared stylesheet. System fonts only, no external requests. */

:root {
  --cream: #FFF8F0;
  --peach: #FFB59E;
  --peach-dark: #F2765A;
  --sage: #A8C5A0;
  --sage-dark: #6E9566;
  --rose: #E8A0A8;
  --rose-dark: #C85C6A;
  --ink: #3D3A36;
  --ink-soft: #746E66;
  --white: #FFFFFF;
  --line: rgba(61, 58, 54, 0.10);
  --shadow: 0 6px 24px rgba(61, 58, 54, 0.12);
  --shadow-sm: 0 2px 10px rgba(61, 58, 54, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 181, 158, 0.28), transparent 42%),
    radial-gradient(circle at 92% 8%, rgba(168, 197, 160, 0.28), transparent 42%),
    var(--cream);
  min-height: 100vh;
}

h1, h2, h3, p { margin: 0 0 0.5em; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
a { color: var(--rose-dark); }
img { max-width: 100%; display: block; }

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 16px 100px;
}
.wrap-wide {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.86rem; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------------------------------------------------------------- brand */

.brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 800; font-size: 1.6rem; margin-bottom: 4px;
}
.brand .balloon { font-size: 1.5em; }

footer.site-footer {
  text-align: center; padding: 28px 16px 20px; color: var(--ink-soft); font-size: 0.85rem;
}
footer.site-footer a { color: var(--ink-soft); text-decoration: underline; }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card + .card { margin-top: 16px; }
.card.tight { padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }

/* ---------------------------------------------------------------- forms */

.field { display: block; margin: 0 0 16px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block; font-weight: 700; font-size: 0.86rem; margin-bottom: 6px; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.04em;
}
input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="file"], textarea, select {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--cream); border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: 14px 16px; min-height: 56px; -webkit-appearance: none; appearance: none;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.4; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--peach-dark); background: var(--white);
}
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: 0.8; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 14px 22px;
  font: inherit; font-size: 1.05rem; font-weight: 800; color: var(--ink);
  background: var(--peach); border: none; border-radius: 16px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn.sage { background: var(--sage); }
.btn.rose { background: var(--rose); color: var(--white); }
.btn.dark { background: var(--ink); color: var(--cream); }
.btn.ghost {
  background: transparent; box-shadow: none; border: 2px solid var(--ink); color: var(--ink);
}
.btn.link { background: transparent; box-shadow: none; color: var(--rose-dark); font-weight: 700; }
.btn.small { min-height: 44px; padding: 10px 18px; font-size: 0.9rem; width: auto; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
@media (min-width: 560px) {
  .btn.auto { width: auto; }
}

/* big tappable choice options (play.html) */
.choice-grid { display: grid; gap: 12px; }
.choice-btn {
  width: 100%; min-height: 64px; padding: 16px 20px; text-align: left;
  font: inherit; font-size: 1.05rem; font-weight: 700; color: var(--ink);
  background: var(--white); border: 2px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease;
}
.choice-btn:active { transform: scale(0.98); }
.choice-btn.picked { border-color: var(--peach-dark); background: #FFF1EC; }
.choice-btn .idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--cream);
  font-size: 0.85rem; font-weight: 800; margin-right: 10px;
}

/* emoji picker */
.emoji-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.emoji-btn {
  min-height: 56px; font-size: 1.5rem; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--white); cursor: pointer;
}
.emoji-btn.picked { border-color: var(--peach-dark); background: #FFF1EC; }

/* ---------------------------------------------------------------- pills / badges */

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px;
  border-radius: 999px; font-size: 0.78rem; font-weight: 800; white-space: nowrap;
  background: var(--line); color: var(--ink-soft);
}
.pill.pending { background: var(--line); color: var(--ink-soft); }
.pill.active { background: var(--peach); color: var(--ink); }
.pill.done { background: var(--sage); color: var(--white); }
.pill.locked { background: var(--ink); color: var(--cream); }

/* ---------------------------------------------------------------- lists */

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }

.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 28px; font-weight: 800; color: var(--ink-soft); text-align: center; }
.lb-emoji { font-size: 1.4rem; }
.lb-name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 800; color: var(--peach-dark); }

/* ---------------------------------------------------------------- status dot */

.status-dot {
  position: fixed; top: 12px; right: 12px; display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--ink-soft); background: rgba(255, 255, 255, 0.9);
  padding: 6px 10px; border-radius: 999px; box-shadow: var(--shadow-sm); z-index: 40;
}
.status-dot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rose-dark); animation: pulse 1.4s ease-in-out infinite; }

/* ---------------------------------------------------------------- prompt photo */

.prompt-photo {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm);
  background: var(--line); margin-bottom: 14px;
}

/* ---------------------------------------------------------------- bottom nav */

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex;
  background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(61,58,54,.08);
  z-index: 30; padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 60px; text-decoration: none; color: var(--ink-soft); font-size: 0.75rem; font-weight: 700;
}
.bottomnav a .ic { font-size: 1.3rem; }
.bottomnav a.active { color: var(--peach-dark); }

/* ---------------------------------------------------------------- upsell / errors */

.upsell {
  background: linear-gradient(135deg, #FFF1EC, #F3F8F1);
  border: 2px dashed var(--peach-dark); border-radius: var(--radius); padding: 18px; text-align: center;
}
.friendly-error {
  background: #FFF1EC; border-radius: var(--radius-sm); padding: 16px; color: var(--ink); text-align: center;
}
.empty {
  text-align: center; color: var(--ink-soft); padding: 24px 12px;
}

/* ---------------------------------------------------------------- score pop + confetti */

.score-pop { display: inline-block; font-weight: 800; color: var(--sage-dark); }
.score-pop.show { animation: pop-up 1.1s ease-out; }
@keyframes pop-up {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  30% { transform: translateY(-6px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-30px) scale(1); opacity: 0; }
}

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 999; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; opacity: 0; border-radius: 2px; }
.confetti.burst i { animation: confetti-fall 1.7s ease-in forwards; }
.confetti i:nth-child(4n+1) { background: var(--peach-dark); }
.confetti i:nth-child(4n+2) { background: var(--sage); }
.confetti i:nth-child(4n+3) { background: var(--rose); }
.confetti i:nth-child(4n) { background: var(--ink); }
.confetti i:nth-child(1) { left: 3%; animation-delay: 0.00s; }
.confetti i:nth-child(2) { left: 10%; animation-delay: 0.08s; }
.confetti i:nth-child(3) { left: 17%; animation-delay: 0.02s; }
.confetti i:nth-child(4) { left: 24%; animation-delay: 0.14s; }
.confetti i:nth-child(5) { left: 31%; animation-delay: 0.05s; }
.confetti i:nth-child(6) { left: 38%; animation-delay: 0.20s; }
.confetti i:nth-child(7) { left: 45%; animation-delay: 0.01s; }
.confetti i:nth-child(8) { left: 52%; animation-delay: 0.16s; }
.confetti i:nth-child(9) { left: 59%; animation-delay: 0.07s; }
.confetti i:nth-child(10) { left: 66%; animation-delay: 0.22s; }
.confetti i:nth-child(11) { left: 73%; animation-delay: 0.03s; }
.confetti i:nth-child(12) { left: 80%; animation-delay: 0.18s; }
.confetti i:nth-child(13) { left: 87%; animation-delay: 0.10s; }
.confetti i:nth-child(14) { left: 94%; animation-delay: 0.24s; }
.confetti i:nth-child(15) { left: 55%; animation-delay: 0.12s; }
.confetti i:nth-child(16) { left: 20%; animation-delay: 0.28s; }
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.35; }
}

/* ---------------------------------------------------------------- host console */

.host-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.joincode {
  font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 900; letter-spacing: 0.04em; color: var(--peach-dark);
  margin: 4px 0;
}
.qrcard { display: inline-block; background: var(--white); padding: 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.qrcard canvas { display: block; width: 200px; height: 200px; }

.tierbadge {
  display: inline-block; padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: 0.8rem;
  background: var(--sage); color: var(--white); text-transform: capitalize;
}

.roundcard { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.roundcard.state-open { border-color: var(--peach-dark); }
.roundcard.state-locked { border-color: var(--ink); }
.roundcard.state-revealed { border-color: var(--sage-dark); background: #F6FAF5; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--cream); font-size: 0.8rem; font-weight: 700; margin: 3px 4px 0 0;
}

table.wishtable { width: 100%; border-collapse: collapse; }
table.wishtable td, table.wishtable th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(61, 58, 54, 0.45); display: flex;
  align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal { background: var(--white); border-radius: var(--radius); padding: 24px; max-width: 420px; width: 100%; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- TV mode */

body.tv {
  background: #2E2438; color: #FFF8F0; min-height: 100vh;
}
body.tv .tv-wrap { max-width: 1200px; margin: 0 auto; padding: 4vw; min-height: 100vh; display: flex; flex-direction: column; }
body.tv h1, body.tv h2, body.tv h3 { color: #FFF8F0; }
body.tv .tv-question { font-size: clamp(2rem, 5vw, 4rem); font-weight: 900; text-align: center; margin: 0.4em 0; }
body.tv .tv-sub { font-size: clamp(1.2rem, 2.4vw, 2rem); text-align: center; color: #E8C9D0; font-weight: 700; }
body.tv .tv-count { font-size: clamp(3rem, 9vw, 7rem); font-weight: 900; text-align: center; color: #FFB59E; }
body.tv .tv-corner {
  position: fixed; bottom: 20px; right: 20px; background: rgba(255, 248, 240, 0.95); border-radius: var(--radius-sm);
  padding: 10px; text-align: center; box-shadow: var(--shadow);
}
body.tv .tv-corner canvas { width: 96px; height: 96px; display: block; margin: 0 auto 4px; }
body.tv .tv-corner .code { color: var(--ink); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.03em; }
body.tv .tv-choice-list { display: grid; gap: 14px; margin-top: 24px; }
body.tv .tv-choice-row {
  display: flex; justify-content: space-between; align-items: center; background: rgba(255, 248, 240, 0.08);
  border-radius: var(--radius-sm); padding: 16px 22px; font-size: clamp(1.1rem, 2.2vw, 1.7rem); font-weight: 700;
}
body.tv .tv-choice-row.correct { background: rgba(168, 197, 160, 0.35); }
body.tv .tv-lb-row { display: flex; align-items: center; gap: 16px; font-size: clamp(1.1rem, 2.4vw, 1.9rem); padding: 10px 0; border-bottom: 1px solid rgba(255,248,240,.12); }
body.tv .tv-lb-row .lb-rank { color: #E8C9D0; }

/* ---------------------------------------------------------------- keepsake / print */

.keepsake-header { text-align: center; margin-bottom: 28px; }
.wish-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px; margin-bottom: 16px; break-inside: avoid; page-break-inside: avoid;
  border-left: 6px solid var(--rose);
}
.wish-card .who { font-weight: 800; margin-bottom: 8px; }
.wish-card .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); font-weight: 800; margin-top: 10px; }
.wish-card .txt { white-space: pre-wrap; }

@media print {
  .no-print { display: none !important; }
  body { background: var(--white) !important; }
  .card, .wish-card { box-shadow: none !important; }
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 360px) {
  body { font-size: 17px; }
  .wrap, .wrap-wide { padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .confetti i { display: none; }
}
