:root {
  color-scheme: dark;
  --bg: #0f172a;
  --fg: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --gold: #fbbf24;
  --success: #22c55e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

[hidden] { display: none !important; }

#ar-container, a-scene {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
}

.screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, #1e293b 0%, #0f172a 60%);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
  overflow-y: auto;
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(20px);
}

.card h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: 0.2px;
}

.card .subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.card p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  color: #cbd5e1;
}

.card .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  font-size: 15px;
}

.emoji {
  font-size: 22px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px 22px;
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px 22px;
  background: transparent;
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 15px;
  text-align: center;
  text-decoration: none;
}

#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: max(env(safe-area-inset-top, 0), 16px) 16px 14px;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0)
  );
  z-index: 15;
  pointer-events: none;
  text-align: center;
}

#progress {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  font-weight: 600;
  font-size: 15px;
}

#found-count {
  color: var(--gold);
  font-size: 18px;
}

.progress-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

#scan-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.banner {
  position: fixed;
  bottom: max(env(safe-area-inset-bottom, 0), 24px);
  left: 50%;
  transform: translate(-50%, 20px);
  min-width: 240px;
  max-width: 86vw;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  z-index: 18;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.banner strong {
  font-size: 16px;
  letter-spacing: 0.2px;
}

.banner span {
  font-size: 13px;
  color: #cbd5e1;
}

.banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.banner.hide {
  opacity: 0;
  transform: translate(-50%, 20px);
}

.banner.error {
  border-color: rgba(248, 113, 113, 0.5);
  opacity: 1;
  transform: translate(-50%, 0);
  top: 24px;
  bottom: auto;
}

.trophy {
  font-size: 56px;
  text-align: center;
  margin-bottom: 8px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 18px 0 14px;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

#win-screen h1 {
  text-align: center;
}

#prize-codes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 18px 0 22px;
}

.prize-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.prize-name { font-size: 14px; }

.prize-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
