/* ===================================================
   KURO ARCANA — Nuit Sans Fin (classes .ns-*) : écran de choix, interface de jeu (HUD), fin de partie
   =================================================== */

/* ---------- Choix ---------- */
.ns-choix { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ns-intro, .ns-record, .ns-note { margin: 0; max-width: 760px; text-align: center; font-size: 1rem; line-height: 1.45; color: rgba(255, 255, 255, 0.85); }
.ns-record b { color: #c8b6ff; font-size: 1.2rem; }
.ns-selection { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: min(100%, 980px); }
.ns-persos { flex: 1 1 420px; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ns-perso {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; padding: 10px 8px;
  border: 2px solid rgba(255, 255, 255, 0.15); border-radius: 14px; color: #fff; cursor: pointer;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--ns-teinte) 35%, transparent), rgba(10, 6, 20, 0.85) 70%);
  font: inherit;
}
.ns-perso.ns-actif { border-color: var(--ns-teinte); box-shadow: 0 0 14px color-mix(in srgb, var(--ns-teinte) 60%, transparent); }
.ns-perso.ns-verrou { opacity: 0.55; }
.ns-perso-image { width: 64px; height: 64px; border-radius: 50%; background: #1a1228 center / cover no-repeat; display: grid; place-items: center; font-size: 1.6rem; }
.ns-perso-nom { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; }
.ns-badge { padding: 2px 8px; border-radius: 999px; background: var(--or-dore, #ffd700); color: #2a1200; font-size: 1rem; font-weight: 700; line-height: 1.2; text-align: center; }
.ns-apercu { flex: 1 1 280px; max-width: 420px; padding: 14px 16px; border: 2px solid color-mix(in srgb, var(--ns-teinte) 55%, transparent); border-radius: 16px; background: rgba(10, 6, 20, 0.75); }
.ns-apercu-nom { margin: 0 0 6px; font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--ns-teinte); }
.ns-apercu .ns-note { text-align: left; }
.ns-verrouille { color: #ffb4b4; }
.ns-capas { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 1rem; }
.ns-capas b { display: block; color: #fff; }
.ns-capas span { color: rgba(255, 255, 255, 0.78); }
.ns-aide { max-width: 760px; font-size: 1rem; color: rgba(255, 255, 255, 0.85); }
.ns-aide summary { min-height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 700; }
.ns-aide ul { padding-left: 18px; line-height: 1.45; }
.ns-sensi { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 44px; }
.ns-sensi input { min-height: 44px; }

/* ---------- Jeu ---------- */
body.ns-en-jeu { overflow: hidden; }
.ns-jeu {
  position: fixed; inset: 0; z-index: 1200; background: #07050d; color: #fff; font-family: 'Raleway', sans-serif;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ns-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ns-hud { position: absolute; inset: 0; pointer-events: none; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.ns-hud button { pointer-events: auto; }
.ns-haut { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; align-items: center; gap: 14px; }
.ns-manche { font-family: 'Cinzel', serif; font-size: 2.6rem; font-weight: 900; color: #c8102e; text-shadow: 0 0 10px rgba(200, 16, 46, 0.7), 2px 2px 0 #000; min-width: 1.2em; }
.ns-points { padding: 4px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.55); font-size: 1.3rem; font-weight: 800; color: #ffd34a; }
.ns-effets { font-size: 1.1rem; font-weight: 700; }
.ns-pause-btn { margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 1.2rem; }
.ns-vie { position: absolute; top: calc(70px + env(safe-area-inset-top)); left: 16px; width: min(220px, 40vw); height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.ns-vie span { display: block; height: 100%; background: linear-gradient(90deg, #ff4060, #ff9a9a); transition: width 0.15s; }
.ns-viseur { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid rgba(255, 255, 255, 0.8); border-radius: 50%; box-shadow: 0 0 0 1px #000; }
.ns-touche { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; opacity: 0;
  background: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%); }
.ns-touche-on .ns-touche { opacity: 1; }
.ns-critique .ns-touche { filter: drop-shadow(0 0 3px #ff2040) hue-rotate(0deg); background-color: transparent; }
.ns-annonce { position: absolute; left: 0; right: 0; top: 24%; margin: 0; text-align: center; font-family: 'Cinzel', serif; font-size: 1.8rem; font-weight: 900; color: #fff; text-shadow: 0 0 12px #6a3cff, 2px 2px 0 #000; opacity: 0; transition: opacity 0.25s; }
.ns-annonce-on .ns-annonce { opacity: 1; }
.ns-invite { position: absolute; left: 16px; right: 16px; bottom: 34%; margin: 0; text-align: center; font-size: 1.1rem; font-weight: 700; text-shadow: 1px 1px 0 #000, 0 0 6px #000; }
.ns-arme { position: absolute; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; text-shadow: 1px 1px 0 #000; }
.ns-arme b { font-size: 1.1rem; }
.ns-arme span { font-size: 1.6rem; font-weight: 800; }
.ns-atouts { position: absolute; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 6px; }
.ns-atouts span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ns-teinte); color: #000; font-weight: 900; font-size: 1rem; box-shadow: 0 0 8px var(--ns-teinte); }
.ns-sang { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(200, 0, 20, 0.85)); }
.ns-a-terre .ns-sang { opacity: 0.9 !important; }
.ns-sans3d { position: absolute; top: 40%; left: 16px; right: 16px; text-align: center; font-size: 1rem; }
.ns-pause { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(5, 3, 10, 0.75); pointer-events: auto; }
.ns-pause[hidden] { display: none; }

/* Commandes tactiles : seulement sur écran tactile */
.ns-joystick, .ns-boutons { display: none; }
.ns-tactile .ns-joystick { display: block; position: absolute; width: 100px; height: 100px; margin: -50px 0 0 -50px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); opacity: 0; left: 22%; top: 70%; }
.ns-tactile .ns-joystick.ns-actif { opacity: 1; }
.ns-joystick span { position: absolute; left: 30px; top: 30px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.ns-tactile .ns-boutons {
  display: grid; position: absolute; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 64px); gap: 10px;
}
.ns-tactile .ns-arme { bottom: calc(16px + env(safe-area-inset-bottom)); }
.ns-btn { width: 64px; height: 64px; border: 2px solid rgba(255, 255, 255, 0.35); border-radius: 50%; background: rgba(0, 0, 0, 0.45); color: #fff; font: 700 1rem 'Raleway', sans-serif; display: grid; place-items: center; position: relative; overflow: hidden; }
.ns-btn.ns-presse { background: rgba(255, 255, 255, 0.3); }
.ns-btn:disabled { opacity: 0.4; }
.ns-btn-tir { background: rgba(200, 16, 46, 0.55); font-size: 1.5rem; }
.ns-btn-action { font-size: 1rem; }
.ns-btn-capa { line-height: 1; }
.ns-btn-capa small { font-size: 1rem; font-weight: 900; }
.ns-btn-capa span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ns-btn-capa.ns-pret { border-color: #8ad7ff; box-shadow: 0 0 10px #4ab0ff; }
.ns-btn-capa i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 1.2rem; background: rgba(0, 0, 0, 0.55); }
.ns-btn-capa i:empty { display: none; }
.ns-tactile .ns-invite { bottom: calc(230px + env(safe-area-inset-bottom)); }

/* ---------- Fin ---------- */
.ns-fin { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; text-align: center; }
.ns-fin-manche { margin: 0; font-family: 'Cinzel', serif; font-size: 1.6rem; }
.ns-fin-manche b { color: #c8102e; font-size: 2.4rem; }
.ns-fin-stats { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; width: min(100%, 360px); font-size: 1rem; }
.ns-fin-stats li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.ns-gain { margin: 0; font-size: 1.1rem; font-weight: 700; color: #ffd34a; }

@media (prefers-reduced-motion: reduce) {
  .ns-annonce, .ns-vie span { transition: none; }
}
