/* Halloween Hunt — mobile-first spooky theme */
:root {
  --bg0: #0d0518;
  --bg1: #1a0b2e;
  --card: rgba(255, 255, 255, 0.055);
  --card-border: rgba(255, 255, 255, 0.13);
  --orange: #ff7b1c;
  --orange-deep: #e85d04;
  --purple: #a855f7;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --text: #f5efff;
  --muted: #b9a8d6;
  --radius: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 50% -10%, #2b1247 0%, var(--bg1) 45%, var(--bg0) 100%);
  min-height: 100vh;
  line-height: 1.55;
}

/* floating background emoji */
.bg-decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.float { position: absolute; font-size: 44px; opacity: 0.16; animation: drift 9s ease-in-out infinite; }
.f1 { top: 8%; left: 6%; }
.f2 { top: 22%; right: 8%; animation-delay: -3s; font-size: 56px; }
.f3 { top: 55%; left: 4%; animation-delay: -5s; }
.f4 { bottom: 18%; right: 10%; animation-delay: -2s; font-size: 38px; }
.f5 { bottom: 8%; left: 12%; animation-delay: -7s; font-size: 60px; }
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-22px) rotate(8deg); }
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: rgba(13, 5, 24, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}
.brand {
  font-family: 'Creepster', cursive; font-size: 22px; letter-spacing: 1px;
  color: var(--orange); text-decoration: none; white-space: nowrap;
}
@media (min-width: 560px) {
  .brand { font-size: 26px; }
}
#topnav { display: flex; gap: 8px; align-items: center; }
#topnav a, #topnav button.linklike {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
  background: none; border: 0; cursor: pointer; padding: 10px 12px; border-radius: 12px;
}
#topnav a:hover, #topnav button.linklike:hover { color: var(--text); background: rgba(255,255,255,0.07); }
#topnav .admin-link { color: var(--gold); }

.wrap { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 24px 18px 60px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
.spooky { font-family: 'Creepster', cursive; letter-spacing: 1.5px; font-weight: 400; }
.hero-title { font-size: 52px; color: var(--orange); text-align: center; margin: 8px 0 4px; text-shadow: 0 4px 24px rgba(255,123,28,0.35); }
.hero-sub { text-align: center; color: var(--muted); font-size: 17px; margin-bottom: 26px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px 24px;
  margin-bottom: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.card h2 { font-size: 22px; }
.card h2 .spooky { font-size: 30px; color: var(--gold); }

.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }

.btn {
  display: block; width: 100%;
  min-height: 58px; padding: 16px 20px;
  border: 0; border-radius: 16px;
  font-size: 17px; font-weight: 700; font-family: inherit;
  cursor: pointer; text-align: center; text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease;
  margin-bottom: 12px;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  color: #1a0b00;
  box-shadow: 0 8px 26px rgba(255, 123, 28, 0.35);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost {
  background: rgba(255,255,255,0.07); color: var(--text);
  border: 1px solid var(--card-border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-danger { background: rgba(248, 113, 113, 0.14); color: var(--red); border: 1px solid rgba(248,113,113,0.4); }
.btn-small { min-height: 0; padding: 10px 14px; font-size: 14px; width: auto; display: inline-block; margin: 0 6px 8px 0; border-radius: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

label.field { display: block; margin-bottom: 16px; }
label.field span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
label.check {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(255, 123, 28, 0.08);
  border: 1px solid rgba(255, 123, 28, 0.35);
  border-radius: 14px; padding: 18px;
  cursor: pointer; font-size: 15.5px;
}
label.check input[type="checkbox"] { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--orange); flex-shrink: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], textarea, select {
  width: 100%; padding: 15px 16px;
  border-radius: 14px; border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.35); color: var(--text);
  font-size: 16px; font-family: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--orange); border-color: var(--orange); }
textarea { min-height: 90px; resize: vertical; }

.how { list-style: none; padding: 0; margin: 0 0 8px; }
.how li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 4px; border-bottom: 1px dashed rgba(255,255,255,0.12);
  font-size: 15.5px;
}
.how li:last-child { border-bottom: 0; }
.how .ico { font-size: 26px; line-height: 1.2; }

.stage-dots { display: flex; gap: 8px; justify-content: center; margin: 6px 0 18px; }
.dot {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--card-border); color: var(--muted);
}
.dot.done { background: rgba(52, 211, 153, 0.18); border-color: var(--green); color: var(--green); }
.dot.now { background: rgba(255, 123, 28, 0.2); border-color: var(--orange); color: var(--orange); box-shadow: 0 0 18px rgba(255,123,28,0.4); }

.clue-box {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 16px; padding: 20px; margin: 16px 0;
  font-size: 18px;
}
.dest-box {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 16px; padding: 20px; margin: 16px 0;
}
.task-box {
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 16px; padding: 20px; margin: 16px 0;
}
.box-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
}
.pill.registered { background: rgba(185,168,214,0.15); color: var(--muted); }
.pill.active { background: rgba(52,211,153,0.15); color: var(--green); }
.pill.eliminated { background: rgba(248,113,113,0.15); color: var(--red); }
.pill.winner { background: rgba(251,191,36,0.18); color: var(--gold); }

.team-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 6px; border-bottom: 1px dashed rgba(255,255,255,0.12);
}
.team-row:last-child { border-bottom: 0; }
.team-name { font-weight: 700; font-size: 16px; }
.team-sub { font-size: 13px; color: var(--muted); }

.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.evidence-card { background: rgba(0,0,0,0.3); border: 1px solid var(--card-border); border-radius: 14px; overflow: hidden; }
.evidence-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.evidence-card .cap { padding: 10px 12px; font-size: 12.5px; }

.preview-img { width: 100%; border-radius: 14px; margin: 12px 0; display: block; max-height: 320px; object-fit: cover; }

.alert { border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; font-size: 15px; }
.alert-error { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.45); color: #fecaca; }
.alert-ok { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.4); color: #a7f3d0; }

.loading { text-align: center; padding: 80px 20px; color: var(--muted); font-size: 18px; }
.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; position: relative; z-index: 1; }

.admin-section { margin-bottom: 26px; }
.admin-section > h3 { font-size: 18px; color: var(--gold); margin-bottom: 10px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin-table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; padding: 10px 8px; border-bottom: 1px solid var(--card-border); }
table.admin-table td { padding: 12px 8px; border-bottom: 1px dashed rgba(255,255,255,0.1); vertical-align: top; }

.stage-edit { border: 1px solid var(--card-border); border-radius: 16px; padding: 18px; margin-bottom: 14px; background: rgba(0,0,0,0.25); }
.stage-edit h4 { margin: 0 0 12px; color: var(--orange); font-size: 17px; }

.divider { border: 0; border-top: 1px solid var(--card-border); margin: 22px 0; }

@media (min-width: 560px) {
  .hero-title { font-size: 64px; }
}

/* password field with eyeball toggle */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 56px !important; width: 100%; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--muted);
  padding: 12px; cursor: pointer; border-radius: 12px; line-height: 0;
}
.pw-toggle:hover, .pw-toggle:active { color: var(--text); }

/* guest list */
.guest-list { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.guest-list li { background: rgba(255,255,255,.06); border: 1px solid var(--card-border); border-radius: 999px; padding: 8px 14px; font-size: 15px; }
