/* OnTour AI party game styles — dark, neon corporate-satire theme. */
:root {
  --void: #05000b;
  --night: #0c0016;
  --card: #14022a;
  --neon-pink: #ff2a8f;
  --neon-purple: #9d4edd;
  --neon-cyan: #22f7ff;
  --gold: #ffd166;
  --orange: #ff7a18;
  --green: #57f58f;
  --muted: #c9a6dc;
  --line: rgba(157, 78, 221, 0.25);
  --glow-pink: 0 0 3px rgba(255, 42, 143, 0.35), 0 0 8px rgba(255, 42, 143, 0.12);
  --glow-cyan: 0 0 3px rgba(34, 247, 255, 0.35), 0 0 8px rgba(34, 247, 255, 0.12);
  --glow-gold: 0 0 3px rgba(255, 209, 102, 0.35), 0 0 8px rgba(255, 209, 102, 0.12);
}

body.app {
  background: var(--void);
  color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  line-height: 1.45;
}

.app-shell {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}

h1, h2, h3 {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
  font-weight: 700;
}

h1 { font-size: 1.7rem; color: var(--neon-pink); text-shadow: var(--glow-pink); }
h2 {
  font-size: 1.25rem;
  color: var(--gold);
  text-transform: uppercase;
  margin: 1.4rem 0 0.6rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
}
h3 { font-size: 1rem; color: var(--neon-cyan); margin: 0 0 0.3rem; }

.muted { color: var(--muted); font-size: 0.85rem; }
.small { font-size: 0.8rem; }
.center { text-align: center; }

/* Top session bar */
.session-bar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.session-greet { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.session-user { font-family: "Bebas Neue", sans-serif; font-size: 1.2rem; color: #fff; }
.token-pill {
  background: rgba(34, 247, 255, 0.12);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.05em;
  text-shadow: var(--glow-cyan);
  white-space: nowrap;
}
.nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav a.is-active { color: var(--neon-pink); border-color: var(--neon-pink); text-shadow: var(--glow-pink); }

/* System banner */
.system-banner {
  font-family: "Orbitron", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px dashed rgba(255, 209, 102, 0.5);
  background: rgba(255, 209, 102, 0.06);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
  font-size: 1rem;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--neon-pink);
  background: rgba(255, 42, 143, 0.12);
  color: var(--neon-pink);
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 42, 143, 0.22); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--cyan { border-color: var(--neon-cyan); color: var(--neon-cyan); background: rgba(34, 247, 255, 0.1); }
.btn--gold { border-color: var(--gold); color: var(--gold); background: rgba(255, 209, 102, 0.1); }
.btn--green { border-color: var(--green); color: var(--green); background: rgba(87, 245, 143, 0.1); }
.btn--ghost { border-color: var(--line); color: var(--muted); background: transparent; }
.btn--block { display: block; width: 100%; text-align: center; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(157, 78, 221, 0.14), rgba(20, 2, 42, 0.6));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.8rem;
}
.card--prompt { border-color: var(--neon-cyan); }
.card--challenge { border-color: var(--neon-pink); }
.card--drop { border-color: var(--gold); background: rgba(255, 209, 102, 0.06); }

/* Stat/identity grid */
.identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.identity-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
}
.identity-cell .label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.identity-cell .value { font-size: 0.95rem; margin-top: 0.2rem; color: #fff; }
.identity-cell .value.score { color: var(--gold); text-shadow: var(--glow-gold); font-family: "Orbitron", sans-serif; }

/* Forms */
.field { margin-bottom: 0.8rem; }
.field label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.3rem; }
.input, .textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 42, 143, 0.4);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--neon-cyan); }
.textarea { min-height: 90px; resize: vertical; }
.char-count { font-size: 0.7rem; color: var(--muted); text-align: right; margin-top: 0.2rem; }

.checkbox-line { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.82rem; color: var(--muted); }
.checkbox-line input { margin-top: 0.2rem; }

.error-text { color: var(--orange); font-size: 0.85rem; margin-top: 0.4rem; }

/* Challenge grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.challenge-card {
  background: rgba(20, 2, 42, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.challenge-card .name { font-family: "Bebas Neue", sans-serif; font-size: 1rem; color: #fff; }
.challenge-card .req { font-size: 0.75rem; color: var(--muted); }
.challenge-card .guide { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }
.state {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  align-self: flex-start;
}
.state-locked { color: var(--muted); border: 1px solid var(--line); }
.state-pending { color: var(--gold); border: 1px solid var(--gold); }
.state-collected { color: var(--green); border: 1px solid var(--green); }
.state-rejected { color: var(--orange); border: 1px solid var(--orange); }
.sub-photo { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin-top: 0.25rem; }

/* Gallery */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
@media (min-width: 720px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
.photo-card { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.photo-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.photo-card .legendary-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--gold); color: #241a02; font-family: "Bebas Neue", sans-serif;
  font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 999px; letter-spacing: 0.05em;
}
.photo-card .caption { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(5,0,11,0.7); font-size: 0.7rem; padding: 0.3rem 0.5rem; }

/* Clue hunt */
.clue-card {
  background: rgba(20, 2, 42, 0.65);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
}
.clue-card.found { border-color: var(--green); box-shadow: 0 0 14px rgba(87, 245, 143, 0.25); }
.clue-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.clue-name { font-family: "Bebas Neue", sans-serif; font-size: 1.05rem; color: #fff; letter-spacing: 0.03em; }
.clue-hint { margin-top: 0.3rem; font-size: 0.78rem; color: var(--neon-cyan); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0.7rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Internal tabs (Photo Challenges / Scavenger Hunt) */
.tabs { display: flex; gap: 0.4rem; margin: 0.75rem 0 1rem; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
.tab {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.95rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
}
.tab:hover { color: #fff; }
.tab.is-active { color: #fff; border-color: var(--neon-cyan); background: rgba(34, 247, 255, 0.08); }

/* Photo viewer modal */
.lightbox { position: fixed; inset: 0; background: rgba(5,0,11,0.92); z-index: 200; display: none; align-items: center; justify-content: center; padding: 1.5rem; flex-direction: column; }
.lightbox.is-visible { display: flex; }
.lightbox img { max-width: 100%; max-height: 70vh; border-radius: 10px; }
.lightbox .lb-meta { margin-top: 0.8rem; text-align: center; color: #fff; }
.lightbox .lb-close { position: absolute; top: 1rem; right: 1.2rem; font-size: 2rem; color: #fff; background: none; border: none; cursor: pointer; }

/* Leaderboard */
.lb-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.lb-rank { font-family: "Orbitron", sans-serif; width: 2rem; color: var(--gold); }
.lb-name { flex: 1; }
.lb-value { font-family: "Orbitron", sans-serif; color: var(--neon-cyan); }
.lb-row.is-you { background: rgba(34, 247, 255, 0.08); }

/* Awards badge case — Pokemon-style round slots, 4x4 for the 16 regular awards */
.badge-case { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem 0.6rem; }
.badge-slot { text-align: center; }
.badge-ring {
  width: 100%; aspect-ratio: 1; border-radius: 50%; margin: 0 auto 0.4rem;
  display: grid; place-items: center; overflow: hidden;
  background: rgba(255,255,255,0.03); border: 2px solid var(--line);
}
.badge-slot.locked .badge-ring { opacity: 0.5; }
.badge-slot.pending .badge-ring { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,209,102,0.35); animation: badgePulse 1.8s infinite; }
.badge-slot.collected .badge-ring { border-color: var(--green); box-shadow: 0 0 16px rgba(87,245,143,0.5); background: rgba(87,245,143,0.08); }
.badge-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.badge-name { font-family: "Bebas Neue", sans-serif; font-size: 0.7rem; line-height: 1.15; color: #fff; }
@keyframes badgePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Inline certificate preview on the awards page */
.cert-mini {
  background: #fff; color: #17121f; border-radius: 12px; padding: 1.3rem 1.2rem;
  position: relative; text-align: center; margin-top: 0.8rem;
}
.cert-mini::before {
  content: ""; position: absolute; inset: 0.45rem;
  border: 2px solid #b9922f; border-radius: 8px; pointer-events: none;
}
.cert-mini .cm-company { font-family: "Orbitron", sans-serif; font-size: 0.6rem; letter-spacing: 0.3em; color: #8a2be2; text-transform: uppercase; }
.cert-mini .cm-title { font-family: "Cinzel", serif; font-size: 1.25rem; letter-spacing: 0.06em; color: #7a1fa2; margin: 0.35rem 0 0.15rem; }
.cert-mini .cm-serial { font-family: "Orbitron", monospace; font-size: 0.55rem; color: #9c8ec0; letter-spacing: 0.12em; }
.cert-mini .cm-name { font-family: "Permanent Marker", cursive; font-size: 1.9rem; color: #b98a12; margin: 0.6rem 0 0.15rem; line-height: 1.1; }
.cert-mini .cm-role { font-family: "Cinzel", serif; font-size: 0.85rem; color: #7a1fa2; }
.cert-mini .cm-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; margin-top: 0.9rem; }
.cert-mini .cm-stat { border: 1px solid #e6d9b8; border-radius: 8px; padding: 0.35rem 0.7rem; min-width: 72px; }
.cert-mini .cm-stat .k { font-family: "Orbitron", sans-serif; font-size: 0.8rem; font-weight: 700; color: #7a1fa2; }
.cert-mini .cm-stat .v { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.08em; color: #8b7ba6; margin-top: 0.1rem; }

/* Shop */
.shop-item { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.shop-item .cost { font-family: "Orbitron", sans-serif; color: var(--gold); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%) translateY(20px);
  background: var(--card); border: 1px solid var(--neon-cyan); color: #fff;
  padding: 0.7rem 1.1rem; border-radius: 10px; font-size: 0.9rem; z-index: 300;
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none;
  max-width: 90%;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--error { border-color: var(--orange); }

/* Count-up / hint */
.hint { font-size: 0.75rem; color: var(--muted); text-align: center; margin-top: 1.5rem; }

/* QR code page */
.qr-badge { font-size: 3rem; text-align: center; margin: 0.5rem 0; }
.big-center { text-align: center; padding-top: 1rem; }
.big-center .final-verdict { font-family: "Permanent Marker", cursive; font-size: 1.2rem; color: var(--gold); margin: 1rem 0; text-shadow: var(--glow-gold); }

/* Admin overrides */
.admin-wrap { max-width: 900px; }
.wide-grid { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
@media (min-width: 720px) { .wide-grid { grid-template-columns: 1fr 1fr; } }
.admin-sub { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-sub img { width: 100%; border-radius: 8px; max-height: 240px; object-fit: cover; }
.howto-list { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--muted); }
.howto-list li { margin-bottom: 0.35rem; }
.howto-list li:last-child { margin-bottom: 0; }

.chip { display: inline-block; font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); margin-right: 0.3rem; }
.badge { display: inline-block; font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-pending { color: var(--gold); border: 1px solid var(--gold); }
.badge-confirmed { color: var(--green); border: 1px solid var(--green); }
.badge-cancelled { color: var(--muted); border: 1px solid var(--line); }

.mono { font-family: "Orbitron", monospace; }

/* Skills */
.skill-row { display: grid; grid-template-columns: 9rem 1fr 2.5rem; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; }
.skill-bar { height: 8px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
.skill-fill { height: 100%; background: linear-gradient(90deg, var(--neon-cyan), var(--gold)); border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
