/* ═══════════════════════════════════════════════════════════════════════
   Nakama Hub — surcouche RPG manga sur tache.css
   Noir #0a0a0b · Turquoise néon #00f5d4 · Jaune #fee440 · Rouge #ef4444
   Bebas Neue (titres) · Outfit (corps) · DM Sans (UI)
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --nk-bg: #0a0a0b;
  --nk-panel: #141419;
  --nk-panel-2: #1a1a21;
  --nk-line: rgba(255, 255, 255, 0.08);
  --nk-neon: #00f5d4;
  --nk-neon-dim: rgba(0, 245, 212, 0.14);
  --nk-gold: #fee440;
  --nk-gold-dim: rgba(254, 228, 64, 0.14);
  --nk-red: #ef4444;
  --nk-muted: #9a9aa6;
  --nk-f-title: 'Bebas Neue', sans-serif;
  --nk-f-body: 'Outfit', sans-serif;
}

/* — Rethème global (surcharge des variables Tâche) — */

body.nk-app {
  --tt-bg: var(--nk-bg);
  --tt-surface: var(--nk-panel);
  --tt-border: var(--nk-line);
  --tt-accent: var(--nk-neon);
  --tt-accent-glow: rgba(0, 245, 212, 0.30);
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(0, 245, 212, 0.07), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(254, 228, 64, 0.05), transparent 60%),
    var(--nk-bg);
  font-family: var(--nk-f-body), system-ui, sans-serif;
  padding-bottom: 84px; /* place pour la tabbar */
}

.nk-header {
  background: linear-gradient(180deg, rgba(0, 245, 212, 0.10), transparent);
  border-bottom: 1px solid var(--nk-line);
}

.nk-brand-icon {
  background: linear-gradient(135deg, var(--nk-neon), #00c9ae);
  color: #06231f;
  box-shadow: 0 0 26px rgba(0, 245, 212, 0.45);
}

.nk-brand-title {
  font-family: var(--nk-f-title);
  font-weight: 400;
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  text-shadow: 0 0 22px rgba(0, 245, 212, 0.35);
}

body.nk-app .tt-card-title {
  font-family: var(--nk-f-title);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.07em;
}

body.nk-app .tt-btn-primary {
  background: linear-gradient(135deg, var(--nk-neon), #00c9ae);
  color: #06231f;
  font-weight: 700;
}

body.nk-app .tt-btn-primary:not(:disabled):hover {
  box-shadow: 0 0 24px rgba(0, 245, 212, 0.45);
}

body.nk-app .tt-chip.is-selected,
body.nk-app .tt-list-item.is-selected {
  border-color: var(--nk-neon);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

body.nk-app .tt-session-timer { color: var(--nk-gold); }

/* ── Tabbar bas d'écran (menu de jeu) ───────────────────────────────── */

.nk-tabbar {
  background: rgba(12, 12, 16, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--nk-line);
  bottom: 0;
  display: flex;
  left: 0;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 30;
}

.nk-tab {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--nk-muted);
  cursor: pointer;
  display: flex;
  flex: 1;
  flex-direction: column;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  gap: 3px;
  letter-spacing: 0.04em;
  padding: 8px 4px;
  transition: color 0.15s, background 0.15s;
}

.nk-tab-ico { font-size: 1.25rem; line-height: 1; }

.nk-tab.is-active {
  background: var(--nk-neon-dim);
  color: var(--nk-neon);
  text-shadow: 0 0 12px rgba(0, 245, 212, 0.5);
}

.nk-tab-panel { animation: nk-fade 0.2s ease; }

@keyframes nk-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ── Verrou de pointage ─────────────────────────────────────────────── */

.nk-clock-card { border: 1px solid var(--nk-line); }

.nk-clock-card.is-allowed { border-color: rgba(0, 245, 212, 0.45); }
.nk-clock-card.is-blocked { border-color: rgba(239, 68, 68, 0.5); }

.nk-clock-row { align-items: center; display: flex; gap: 12px; }

.nk-clock-ico { font-size: 1.6rem; line-height: 1; }

.nk-clock-text { display: flex; flex-direction: column; gap: 2px; }

.nk-clock-text strong { font-size: 0.95rem; }

.nk-clock-text small { color: var(--nk-muted); font-size: 0.78rem; }

.nk-clock-card.is-allowed .nk-clock-text strong { color: var(--nk-neon); }
.nk-clock-card.is-blocked .nk-clock-text strong { color: var(--nk-red); }

.nk-nfc-btn { margin-top: 10px; width: 100%; }

.nk-start-btn { position: relative; }

.nk-start-lock { margin-right: 6px; }

.nk-start-btn:not(:disabled) .nk-start-lock { display: none; }

/* ── Profil RPG ─────────────────────────────────────────────────────── */

.nk-rank-card {
  background: linear-gradient(160deg, var(--nk-panel-2), var(--nk-panel));
  border: 1px solid rgba(0, 245, 212, 0.25);
  box-shadow: 0 0 30px rgba(0, 245, 212, 0.08);
}

.nk-rank-head { align-items: center; display: flex; gap: 14px; }

.nk-rank-icon {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(254, 228, 64, 0.4));
}

.nk-rank-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.nk-rank-label {
  color: var(--nk-neon);
  font-family: var(--nk-f-title);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  margin: 2px 0 0;
  text-shadow: 0 0 16px rgba(0, 245, 212, 0.4);
}

.nk-rank-xp {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
}

.nk-rank-xp b {
  color: var(--nk-gold);
  font-family: var(--nk-f-title);
  font-size: 1.9rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(254, 228, 64, 0.4);
}

.nk-rank-xp small {
  color: var(--nk-muted);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nk-xp-bar {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  height: 12px;
  margin-top: 16px;
  overflow: hidden;
}

.nk-xp-fill {
  background: linear-gradient(90deg, #00c9ae, var(--nk-neon), var(--nk-gold));
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(0, 245, 212, 0.5);
  height: 100%;
  transition: width 0.8s ease;
  width: 0;
}

.nk-xp-next {
  color: var(--nk-muted);
  font-size: 0.8rem;
  margin: 8px 0 0;
}

.nk-profile-unlinked {
  background: var(--nk-gold-dim);
  border: 1px dashed rgba(254, 228, 64, 0.4);
  border-radius: 10px;
  color: var(--nk-gold);
  font-size: 0.8rem;
  margin: 12px 0 0;
  padding: 8px 12px;
}

/* — Streak — */

.nk-streak-card {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
}

.nk-streak-cell { display: flex; flex-direction: column; gap: 4px; }

.nk-streak-num {
  color: var(--nk-neon);
  font-family: var(--nk-f-title);
  font-size: 1.9rem;
  line-height: 1;
}

.nk-streak-num.is-gold { color: var(--nk-gold); }

.nk-streak-cell small { color: var(--nk-muted); font-size: 0.68rem; }

/* — Titres — */

.nk-titles { display: flex; flex-direction: column; gap: 8px; }

.nk-title {
  align-items: center;
  background: var(--nk-panel-2);
  border: 1px solid var(--nk-line);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  padding: 10px 14px;
}

.nk-title.is-earned {
  border-color: rgba(254, 228, 64, 0.45);
  box-shadow: 0 0 16px rgba(254, 228, 64, 0.12);
}

.nk-title.is-locked { opacity: 0.45; filter: grayscale(0.7); }

.nk-title-ico { font-size: 1.5rem; line-height: 1; }

.nk-title-body strong { display: block; font-size: 0.92rem; }

.nk-title-body small { color: var(--nk-muted); font-size: 0.75rem; }

.nk-title-earned-at {
  color: var(--nk-gold);
  font-size: 0.7rem;
  margin-left: auto;
  white-space: nowrap;
}

/* — Leaderboard XP — */

.nk-xp-board { list-style: none; margin: 0; padding: 0; }

.nk-xp-board li {
  align-items: center;
  border-bottom: 1px solid var(--nk-line);
  display: flex;
  gap: 10px;
  padding: 9px 2px;
}

.nk-xp-board li:last-child { border-bottom: none; }

.nk-xp-board .pos {
  color: var(--nk-gold);
  font-family: var(--nk-f-title);
  font-size: 1.1rem;
  width: 26px;
}

.nk-xp-board .who { flex: 1; font-size: 0.9rem; }

.nk-xp-board .pts {
  color: var(--nk-neon);
  font-family: 'DM Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.nk-xp-board .stk { color: var(--nk-muted); font-size: 0.72rem; }

/* — Toast XP fin de session — */

.nk-xp-toast {
  background: var(--nk-gold-dim);
  border: 1px solid rgba(254, 228, 64, 0.4);
  border-radius: 10px;
  color: var(--nk-gold);
  font-weight: 600;
  margin: 10px 0 0;
  padding: 10px 14px;
}

/* ── Bourse aux shifts ──────────────────────────────────────────────── */

.nk-shift-list { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }

.nk-shift {
  background: var(--nk-panel-2);
  border: 1px solid var(--nk-line);
  border-left: 3px solid var(--nk-neon);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
}

.nk-shift.is-open { border-left-color: var(--nk-gold); }
.nk-shift.is-pending { border-left-color: var(--nk-gold); }
.nk-shift.is-approved { border-left-color: var(--nk-neon); }
.nk-shift.is-refused, .nk-shift.is-cancelled { border-left-color: var(--nk-red); opacity: 0.7; }

.nk-shift-top {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.nk-shift-date { font-weight: 700; font-size: 0.95rem; }

.nk-shift-role {
  background: var(--nk-neon-dim);
  border-radius: 999px;
  color: var(--nk-neon);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  text-transform: uppercase;
}

.nk-shift-meta { color: var(--nk-muted); font-size: 0.78rem; }

.nk-shift-msg {
  color: var(--nk-gold);
  font-size: 0.8rem;
  font-style: italic;
}

.nk-shift-status {
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  width: fit-content;
}

.nk-shift-status.is-open { background: var(--nk-gold-dim); color: var(--nk-gold); }
.nk-shift-status.is-claimed { background: var(--nk-gold-dim); color: var(--nk-gold); }
.nk-shift-status.is-approved { background: var(--nk-neon-dim); color: var(--nk-neon); }
.nk-shift-status.is-refused, .nk-shift-status.is-cancelled {
  background: rgba(239, 68, 68, 0.14); color: var(--nk-red);
}

.nk-shift-actions { display: flex; gap: 8px; margin-top: 4px; }

.nk-shift-actions .tt-btn { flex: 1; font-size: 0.82rem; padding: 8px 10px; }

.nk-incident-btn { margin-top: 14px; }

/* ── Responsive fin ─────────────────────────────────────────────────── */

@media (min-width: 720px) {
  .nk-tabbar {
    border-radius: 16px;
    bottom: 14px;
    left: 50%;
    max-width: 420px;
    right: auto;
    transform: translateX(-50%);
    border: 1px solid var(--nk-line);
  }
}
