/* Comic-Con 2026 Scavenger Hunt — comic book theme */

:root {
  --pink: #ff2e88;
  --purple: #7b2ff7;
  --teal: #00c2cb;
  --yellow: #ffd93d;
  --ink: #1a1032;
  --paper: #fdf6ec;
  --white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Comic Neue", "Comic Sans MS", cursive, sans-serif;
  background-color: var(--purple);
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 12%, transparent 13%);
  background-size: 24px 24px;
  color: var(--ink);
  min-height: 100vh;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 12px 80px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin-bottom: 16px;
}

.hero img {
  width: 100%;
  max-width: 680px;
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 8px 8px 0 var(--ink);
}

h1.title {
  font-family: "Bangers", cursive;
  font-size: clamp(2rem, 7vw, 3.2rem);
  color: var(--yellow);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--pink);
  letter-spacing: 2px;
  margin: 10px 0 4px;
}

.subtitle {
  color: var(--white);
  font-weight: 700;
  font-size: 1.05rem;
}

/* ---------- Comic panels ---------- */
.panel {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 18px 16px;
  margin-bottom: 22px;
}

.panel h2 {
  font-family: "Bangers", cursive;
  font-size: 1.7rem;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pts-badge {
  font-family: "Bangers", cursive;
  font-size: 0.95rem;
  letter-spacing: 1px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 2px 12px;
  box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}

.cat-progress {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple);
  margin-left: auto;
}

/* ---------- Checklist items ---------- */
ul.checklist { list-style: none; margin-top: 12px; }

.checklist li { margin-bottom: 8px; }

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
}

.checklist label:active { transform: scale(0.98); }

.checklist input[type="checkbox"] {
  appearance: none;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  background: var(--white);
  cursor: pointer;
  position: relative;
}

.checklist input[type="checkbox"]:checked {
  background: var(--pink);
}

.checklist input[type="checkbox"]:checked::after {
  content: "✔";
  color: var(--white);
  font-size: 18px;
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checklist li.done label {
  background: #d9f7e8;
  text-decoration: line-through;
  color: #55636f;
}

.checklist li.bonus label {
  background: #fff3c4;
  border-style: dashed;
}

.item-pts {
  margin-left: auto;
  font-family: "Bangers", cursive;
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: var(--purple);
  white-space: nowrap;
  padding-left: 8px;
}

/* ---------- Score bar ---------- */
.scorebar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 4px solid var(--yellow);
  z-index: 50;
}

.scorebar .score {
  font-family: "Bangers", cursive;
  font-size: 1.5rem;
  letter-spacing: 2px;
  color: var(--yellow);
}

.scorebar .player-chip {
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorebar button {
  font-family: "Comic Neue", "Comic Sans MS", cursive, sans-serif;
  font-weight: 700;
  background: var(--pink);
  color: var(--white);
  border: 3px solid var(--white);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
}

/* ---------- Progress ---------- */
.progress-outer {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 999px;
  height: 22px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--teal));
  width: 0%;
  transition: width 0.4s ease;
}

/* ---------- Name / welcome screen ---------- */
.welcome {
  text-align: center;
  padding: 28px 18px;
}

.welcome p {
  font-weight: 700;
  margin: 10px 0 18px;
  font-size: 1.05rem;
}

.welcome input[type="text"] {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.btn-pow {
  font-family: "Bangers", cursive;
  font-size: 1.3rem;
  letter-spacing: 2px;
  background: var(--pink);
  color: var(--white);
  border: 4px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 28px;
  margin-top: 16px;
  cursor: pointer;
  transition: transform 0.08s ease;
}

.btn-pow:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.returning-players { margin-top: 20px; }

.returning-players .chip {
  display: inline-block;
  font-weight: 700;
  background: var(--teal);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 6px 16px;
  margin: 4px;
  cursor: pointer;
}

/* ---------- Leaderboard ---------- */
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 8px;
  font-weight: 700;
}

.lb-row.lb-me {
  background: #fff3c4;
  border-color: var(--pink);
}

.lb-rank {
  flex: 0 0 42px;
  font-family: "Bangers", cursive;
  font-size: 1.2rem;
  letter-spacing: 1px;
  text-align: center;
}

.lb-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-bar {
  flex: 0 0 90px;
  height: 12px;
  background: #eee4d6;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.lb-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--teal));
}

.lb-score {
  flex: 0 0 auto;
  font-family: "Bangers", cursive;
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--purple);
}

.lb-empty { font-weight: 700; margin-top: 8px; color: #4a3f6b; }

@media (max-width: 420px) {
  .lb-bar { display: none; }
}

/* ---------- Sync ---------- */
.sync-line {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 10px;
  color: #4a3f6b;
}

.sync-line strong {
  font-family: "Bangers", cursive;
  font-size: 1.1rem;
  letter-spacing: 2px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 1px 8px;
}

#sync-status { color: #2e9e6b; }
#sync-status.sync-off { color: #c0392b; }

.join-code {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 3px dashed #d8c9b8;
}

.join-code input[type="text"] {
  font-family: "Bangers", cursive;
  font-size: 1.3rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  width: 100%;
  max-width: 200px;
  text-align: center;
}

.btn-small { font-size: 1.05rem; padding: 8px 20px; }

.join-error { color: #c0392b; font-size: 0.9rem; }

/* ---------- Secret mission ---------- */
.secret-card {
  background: var(--ink);
  color: var(--yellow);
  border-radius: 10px;
  border: 3px dashed var(--yellow);
  padding: 18px;
  text-align: center;
  font-family: "Bangers", cursive;
  font-size: 1.4rem;
  letter-spacing: 1.5px;
  margin-top: 12px;
}

.secret-hint {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 10px;
  color: #4a3f6b;
}

/* ---------- Golden challenge ---------- */
.panel.golden {
  background: linear-gradient(135deg, #fff7d6, #ffe9a8);
  border-color: #a87900;
  box-shadow: 6px 6px 0 #a87900;
}

.panel.golden h2 { color: #7a5800; }

.golden-status {
  font-family: "Bangers", cursive;
  font-size: 1.2rem;
  text-align: center;
  margin-top: 12px;
  letter-spacing: 1px;
}

/* ---------- Safety ---------- */
.panel.safety { background: #e8f6ff; }
.panel.safety ul { list-style: none; margin-top: 10px; }
.panel.safety li {
  font-weight: 700;
  padding: 6px 0;
  border-bottom: 2px dashed #9cc9e8;
}
.panel.safety li:last-child { border-bottom: none; }
.panel.safety li::before { content: "🛡️ "; }

/* ---------- Confetti-ish pop ---------- */
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25) rotate(-3deg); }
  100% { transform: scale(1); }
}
.pop { animation: pop 0.3s ease; }

.hidden { display: none !important; }

@media (max-width: 480px) {
  .panel { padding: 14px 10px; }
  .checklist label { font-size: 0.95rem; }
}
