/* Shell styling for the World mini app.
   Follows World's mini app guidelines: mobile only, no bounce scrolling,
   dynamic viewport height, and safe-area padding for notched devices. */

:root {
  --bg: #0f0f10;
  --surface: #1b1b1e;
  --text: #f6f6f7;
  --muted: #9a9aa2;
  --accent: #ffffff;
  --accent-text: #0f0f10;
  --track: #2c2c31;
  --radius: 18px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f4f5;
    --surface: #ffffff;
    --text: #0f0f10;
    --muted: #6b6b73;
    --accent: #0f0f10;
    --accent-text: #ffffff;
    --track: #e4e4e8;
  }
}

* { box-sizing: border-box; }

/* `display: block` on .btn outranks the user-agent [hidden] rule, which would
   otherwise keep the localhost-only bypass button off production. Without
   this the World ID gate is visibly skippable on the live site. */
[hidden] { display: none !important; }


html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Mini apps must not rubber-band inside the World App webview. */
  overscroll-behavior: none;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Unity stage ---- */

/* The stage always participates in layout, even while covered by the shell:
   a display:none canvas has no box, so Unity would size its drawing buffer to
   the 300x150 default and never recover. The shell simply paints over it. */
#stage {
  position: fixed;
  inset: 0;
  background: var(--bg);
}

body.is-playing #shell { display: none; }

#unity-canvas {
  display: block;
  width: 100%;
  height: 100dvh;
  /* Fallback for webviews without dynamic viewport units. */
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  touch-action: none;
}

/* ---- Shell ---- */

#shell {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

.brand { margin-bottom: 28px; }

.mark {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 18px;
  object-fit: cover;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Only one panel is visible at a time. */
.panel { display: none; }
.panel.is-active { display: block; }

.lede {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.5;
}

.fineprint {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:active { opacity: 0.7; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-ghost {
  margin-top: 12px;
  background: transparent;
  color: var(--muted);
}

/* ---- Progress ---- */

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 20px;
  border: 3px solid var(--track);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .bar-fill { transition: none; }
}
