/* NIDYA BIRD – styles isolés sous #nb-app (aucun impact sur le reste du site) */
#nb-app, #nb-app * { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0f1c4d; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; width: 100%; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
#nb-app {
  --nb-blue: #2f5fff; --nb-blue-2: #3d5afe; --nb-violet: #4318ff; --nb-ink: #0f1c4d; --nb-pink: #d6336c;
  --nb-bg: #f3f6fd; --nb-muted: #5f6577; --nb-radius: 24px;
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--nb-ink);
  background: radial-gradient(circle at 30% 20%, #2a3d8f 0, #0f1c4d 60%);
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
#nb-stage { position: relative; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; }
#nb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }

/* HUD */
.nb-hud { position: absolute; left: 0; right: 0; top: 0; max-width: 900px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 0; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.nb-hud[hidden] { display: none; }
.nb-hud-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nb-score { font-size: 34px; font-weight: 700; color: #fff; text-shadow: 0 2px 0 rgba(15,28,77,.35), 0 0 18px rgba(15,28,77,.25); line-height: 1; letter-spacing: -.5px; }
.nb-best { font-size: 12px; font-weight: 500; color: #fff; opacity: .92; text-shadow: 0 1px 2px rgba(15,28,77,.5); }
.nb-disc { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 99px; background: rgba(15,28,77,.32); font-size: 11px; font-weight: 600; color: #fff; transition: background .25s, transform .25s; }
.nb-disc.is-new { background: #ffd54a; color: #0f1c4d; transform: scale(1.08); }
.nb-hud-btns { display: flex; gap: 8px; pointer-events: auto; }
.nb-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--nb-blue); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(15,28,77,.18); }
.nb-icon-btn svg { width: 20px; height: 20px; }
.nb-icon-btn:focus-visible, .nb-btn:focus-visible, .nb-link:focus-visible, .nb-field input:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
.nb-progress { position: relative; height: 8px; border-radius: 8px; background: rgba(255,255,255,.45); overflow: visible; }
.nb-progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 8px; background: linear-gradient(90deg, #fff, #ffe08a); }
.nb-progress-tick { position: absolute; top: -2px; width: 2px; height: 12px; background: rgba(15,28,77,.35); border-radius: 2px; }
.nb-progress-dove { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #2f5fff; box-shadow: 0 2px 8px rgba(15,28,77,.35); }
.nb-effects { display: flex; gap: 6px; flex-wrap: wrap; min-height: 26px; }
.nb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; background: rgba(255,255,255,.94); font-size: 11px; font-weight: 600; color: var(--nb-ink); box-shadow: 0 3px 10px rgba(15,28,77,.18); }
.nb-chip i { width: 18px; height: 18px; border-radius: 50%; display: block; background: conic-gradient(var(--c, #2f5fff) calc(var(--p, 1) * 360deg), #e4e8f5 0); }

/* Bandeau de zone */
.nb-banner { position: absolute; left: 50%; max-width: 520px; top: calc(118px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px); width: min(92%, 380px); padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,.93); box-shadow: 0 10px 30px rgba(15,28,77,.22); text-align: center; opacity: 0; transition: opacity .35s, transform .35s; pointer-events: none; }
.nb-banner.is-on { opacity: 1; transform: translate(-50%, 0); }
.nb-banner b { display: block; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--nb-blue); }
.nb-banner span { display: block; font-size: 13.5px; line-height: 1.35; margin-top: 2px; }

/* Compte à rebours / messages centraux */
.nb-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.nb-count { font-size: 110px; font-weight: 700; color: #fff; text-shadow: 0 6px 0 rgba(15,28,77,.3), 0 0 40px rgba(47,95,255,.5); animation: nb-pop .9s ease-out both; }
.nb-count.is-go { font-size: 64px; }
@keyframes nb-pop { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: .95; } }

/* Écrans (accueil, inscription, résultat, classement, règles, confidentialité) */
.nb-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.nb-screen[hidden] { display: none; }
.nb-screen.is-dim { background: rgba(15,28,77,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.nb-card { width: 100%; max-width: 370px; background: #fff; border-radius: var(--nb-radius); padding: 22px 20px; box-shadow: 0 20px 50px rgba(15,28,77,.3); animation: nb-rise .35s ease-out both; }
@keyframes nb-rise { from { transform: translateY(16px); opacity: 0; } }
.nb-title { margin: 0; font-size: 50px; line-height: .95; font-weight: 700; color: var(--nb-blue); text-align: center; letter-spacing: -1px; text-shadow: 0 3px 0 #fff, 0 6px 18px rgba(47,95,255,.25); }
.nb-title small { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 2.5px; margin: 12px auto 0; padding: 5px 12px; border-radius: 99px; color: #fff; background: var(--nb-pink); text-shadow: none; display: table; }
.nb-lead { margin: 14px auto 0; max-width: 330px; text-align: center; color: var(--nb-ink); font-size: 14px; line-height: 1.5; background: rgba(255,255,255,.72); padding: 10px 14px; border-radius: 16px; }
.nb-home-spacer { flex: 1 1 auto; min-height: 210px; }
.nb-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 330px; margin-top: 16px; }
.nb-row { display: flex; gap: 10px; }
.nb-row > * { flex: 1; }
.nb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 18px; border-radius: 99px; border: 2px solid transparent; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .2s, background-color .2s; }
.nb-btn:active { transform: scale(.97); }
.nb-btn-primary { background: linear-gradient(135deg, #3d5afe, #6c4dff); color: #fff; box-shadow: 0 10px 24px -8px rgba(67,24,255,.7); font-size: 17px; letter-spacing: .5px; }
.nb-btn-primary:hover { box-shadow: 0 14px 30px -8px rgba(67,24,255,.85); }
.nb-btn-light { background: rgba(255,255,255,.95); color: var(--nb-blue); }
.nb-btn-ghost { background: transparent; color: var(--nb-blue); border-color: var(--nb-blue); }
.nb-btn[disabled] { opacity: .6; cursor: wait; }
.nb-player { margin-top: 12px; color: var(--nb-ink); font-size: 13px; text-align: center; background: rgba(255,255,255,.8); padding: 4px 12px; border-radius: 99px; }
.nb-link { background: none; border: 0; padding: 4px; font: inherit; font-size: 13px; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.nb-card .nb-link { color: var(--nb-blue); }
.nb-h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; color: var(--nb-blue); }
.nb-p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--nb-ink); }
.nb-small { font-size: 11.5px; line-height: 1.5; color: var(--nb-muted); }
.nb-small a { color: var(--nb-blue); }

/* Formulaire */
.nb-field { display: block; margin: 0 0 12px; }
.nb-field > span { display: block; font-size: 12.5px; font-weight: 600; margin: 0 0 5px 4px; color: var(--nb-ink); }
.nb-field input { width: 100%; height: 48px; padding: 0 16px; border-radius: 14px; border: 1.5px solid #c9d2ee; font: inherit; font-size: 16px; color: var(--nb-ink); background: #f8faff; user-select: text; -webkit-user-select: text; }
.nb-field input:focus { border-color: var(--nb-blue); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(47,95,255,.15); }
.nb-field.is-error input { border-color: #d93a48; }
.nb-err { display: none; font-size: 12px; color: #c62f3d; margin: 4px 0 0 4px; }
.nb-field.is-error .nb-err { display: block; }
.nb-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; font-size: 12.5px; line-height: 1.45; color: var(--nb-ink); cursor: pointer; }
.nb-check input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--nb-blue); }
.nb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.nb-form-msg { min-height: 18px; font-size: 12.5px; color: #c62f3d; margin: 0 0 8px; }
.nb-legal { max-height: 0; overflow: hidden; transition: max-height .3s; }
.nb-legal.is-open { max-height: 600px; }

/* Résultat */
.nb-result-head { text-align: center; }
.nb-result-name { font-size: 14px; color: var(--nb-muted); margin: 0; }
.nb-result-score { font-size: 54px; font-weight: 700; color: var(--nb-blue); line-height: 1.05; margin: 2px 0; }
.nb-result-title { display: inline-block; padding: 5px 14px; border-radius: 99px; background: linear-gradient(135deg, #3d5afe, #6c4dff); color: #fff; font-size: 13px; font-weight: 600; }
.nb-result-msg { margin: 12px 0 0; font-size: 14px; line-height: 1.45; text-align: center; font-style: italic; }
.nb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.nb-stat { background: var(--nb-bg); border-radius: 14px; padding: 10px 6px; text-align: center; }
.nb-stat b { display: block; font-size: 17px; color: var(--nb-ink); }
.nb-stat span { font-size: 10.5px; color: var(--nb-muted); text-transform: uppercase; letter-spacing: .6px; }
.nb-record { text-align: center; font-weight: 700; color: var(--nb-pink); margin: 6px 0 0; animation: nb-pulse 1.2s ease-in-out infinite; }
@keyframes nb-pulse { 50% { transform: scale(1.06); } }
.nb-promo { margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--nb-bg); font-size: 12.5px; line-height: 1.5; }
.nb-promo a { color: var(--nb-blue); font-weight: 600; }
.nb-fresh { text-align: center; margin: -4px 0 10px; color: var(--nb-ink); }

/* Classement */
.nb-tabs { display: flex; gap: 6px; padding: 4px; background: var(--nb-bg); border-radius: 99px; margin: 10px 0 12px; }
.nb-tab { flex: 1; border: 0; background: transparent; border-radius: 99px; padding: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--nb-muted); cursor: pointer; }
.nb-tab[aria-selected="true"] { background: #fff; color: var(--nb-blue); box-shadow: 0 2px 8px rgba(15,28,77,.1); }
.nb-board { list-style: none; margin: 0; padding: 0; }
.nb-board li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; font-size: 14px; }
.nb-board li:nth-child(odd) { background: #f7f9ff; }
.nb-board li.is-me { background: #e8edff; font-weight: 700; }
.nb-rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #e4e8f5; color: var(--nb-ink); flex-shrink: 0; }
.nb-board li:nth-child(1) .nb-rank { background: #ffd54a; } .nb-board li:nth-child(2) .nb-rank { background: #dfe3ec; } .nb-board li:nth-child(3) .nb-rank { background: #f3b98a; }
.nb-board .nb-name { flex: 1; } .nb-board .nb-pts { font-weight: 700; color: var(--nb-blue); }
.nb-empty { text-align: center; font-size: 13px; color: var(--nb-muted); padding: 18px 0; }
.nb-me-line { margin-top: 10px; font-size: 13px; text-align: center; color: var(--nb-ink); }

/* Pause, toast */
.nb-pause { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15,28,77,.5); color: #fff; text-align: center; font-size: 18px; font-weight: 600; }
.nb-pause[hidden] { display: none; }
.nb-toast { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); max-width: 88%; padding: 12px 16px; border-radius: 16px; background: rgba(15,28,77,.94); color: #fff; font-size: 13.5px; line-height: 1.4; text-align: center; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; z-index: 5; }
.nb-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  #nb-app *, #nb-app *::before, #nb-app *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.nb-logo { display: block; width: auto; height: auto; max-width: min(88vw, 460px); max-height: 24vh; max-height: 24dvh; margin: 0 auto; filter: drop-shadow(0 6px 16px rgba(47,95,255,.18)); }
.nb-title .nb-logo + small { margin-top: 2px; }

/* Accueil : tout tient dans l'écran, aucun défilement */
.nb-screen[data-screen="home"] { overflow: hidden; justify-content: flex-start; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.nb-screen[data-screen="home"] .nb-home-spacer { flex: 1 1 auto; min-height: 0; }
.nb-screen[data-screen="home"] .nb-actions { margin-top: 0; }
.nb-screen[data-screen="home"] .nb-lead { margin-top: 8px; font-size: clamp(12px, 1.8vh, 14px); }
@media (max-height: 720px) {
  .nb-screen[data-screen="home"] .nb-title small { margin-top: 0; font-size: 10px; padding: 3px 10px; }
  .nb-screen[data-screen="home"] .nb-btn { min-height: 42px; padding: 8px 14px; font-size: 14px; }
  .nb-screen[data-screen="home"] .nb-btn-primary { font-size: 15px; }
  .nb-screen[data-screen="home"] .nb-actions { gap: 7px; }
  .nb-screen[data-screen="home"] .nb-player { margin-top: 6px; }
}
@media (max-height: 600px) { .nb-screen[data-screen="home"] .nb-lead { display: none; } }
/* Les autres écrans (formulaire, classement) défilent à l'intérieur de la carte si nécessaire, jamais la page */
.nb-screen:not([data-screen="home"]) { justify-content: safe center; }
