/* ============================================================
   ARISE — Système du Monarque
   Mobile-first PWA, Solo Leveling aesthetic
   ============================================================ */

:root {
  --bg-void: #06080d;
  --bg-deep: #0a0e15;
  --bg-card: #0f141d;
  --bg-card-hover: #161c27;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(99, 102, 241, 0.3);
  --accent-blue: #6366f1;
  --accent-blue-bright: #818cf8;
  --accent-blue-glow: rgba(99, 102, 241, 0.4);
  --accent-gold: #d4a574;
  --accent-gold-bright: #fbbf24;
  --accent-gold-glow: rgba(251, 191, 36, 0.4);
  --accent-purple: #a78bfa;
  --accent-purple-glow: rgba(167, 139, 250, 0.4);
  --success: #34d399;
  --success-glow: rgba(52, 211, 153, 0.4);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --warning: #f59e0b;
  --text: #fafafa;
  --text-dim: #94a3b8;
  --text-mute: #64748b;
  --text-faint: #475569;
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-top: env(safe-area-inset-top, 0);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg-void);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(251, 191, 36, 0.04) 0%, transparent 50%);
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.screen.active {
  display: flex;
}

/* ============================================================
   STARS BACKGROUND
   ============================================================ */
.stars-bg, .stars-bg-soft {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.stars-bg-soft {
  opacity: 0.4;
}
.star-bg {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
  animation: twinkle 3s infinite ease-in-out;
}
.star-bg:nth-child(odd) { animation-duration: 4s; }
.star-bg:nth-child(3n) { animation-duration: 5s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ============================================================
   PIN SCREEN
   ============================================================ */
#screen-pin {
  align-items: center;
  justify-content: center;
  padding: max(24px, var(--safe-top)) 16px max(24px, var(--safe-bottom));
  background:
    radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, rgba(251, 191, 36, 0.05) 0%, transparent 60%),
    var(--bg-void);
}
.pin-wrap {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 360px;
}
.pin-tree-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
}
.pin-glyph {
  font-size: 48px;
  filter: drop-shadow(0 0 24px var(--accent-gold-glow));
  margin-bottom: 16px;
  animation: pulse-gold 3s infinite ease-in-out;
}
@keyframes pulse-gold {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.pin-title {
  font-family: 'Cinzel', serif;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.18em;
  background: linear-gradient(135deg, #fff 0%, var(--accent-blue-bright) 50%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.pin-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 32px;
  min-height: 24px;
}
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 40px;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  transition: all 0.2s ease;
}
.pin-dot.filled {
  background: var(--accent-gold-bright);
  border-color: var(--accent-gold-bright);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}
.pin-dot.error {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 12px var(--danger-glow);
  animation: shake 0.5s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}
.pin-key {
  height: 64px;
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  transition: all 0.15s ease;
}
.pin-key:active {
  background: var(--bg-card-hover);
  transform: scale(0.96);
}
.pin-key-aux {
  font-size: 22px;
  color: var(--text-dim);
}
.pin-hint {
  margin-top: 24px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-mute);
  min-height: 20px;
}
.pin-hint.error {
  color: var(--danger);
}
.pin-hint.success {
  color: var(--accent-gold-bright);
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
#screen-app {
  background: var(--bg-void);
}
.app-header {
  flex-shrink: 0;
  padding: max(12px, var(--safe-top)) 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 8, 13, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-tree-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
  flex-shrink: 0;
}
.app-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text);
}
.app-rank-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-blue-glow);
  color: var(--accent-blue-bright);
  border: 1px solid var(--border-glow);
  letter-spacing: 0.12em;
}
.app-header-right {
  display: flex;
  gap: 6px;
}
.app-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dim);
  transition: all 0.15s ease;
}
.app-icon-btn:active {
  background: var(--bg-card-hover);
  transform: scale(0.95);
}

.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(80px + var(--safe-bottom));
  position: relative;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
  position: relative;
  z-index: 1;
}
.tab-content.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-head {
  margin-bottom: 16px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.tab-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.tab-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--text-dim);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}
.card-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-gold-bright);
  text-transform: uppercase;
}
.card-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
}

/* ============================================================
   HUNTER CARD
   ============================================================ */
.hunter-card {
  position: relative;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  overflow: hidden;
  z-index: 2;
}
.hunter-card-glow {
  position: absolute;
  top: -50%;
  right: -30%;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
  pointer-events: none;
}
.hunter-card-header {
  position: relative;
  margin-bottom: 16px;
}
.hunter-id {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hunter-rank-glyph {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--accent-gold-bright);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
  border: 1.5px solid var(--accent-gold);
  border-radius: 14px;
  box-shadow: 0 0 20px var(--accent-gold-glow), inset 0 0 12px rgba(251, 191, 36, 0.1);
  letter-spacing: 0.05em;
}
.hunter-name {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.hunter-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}
.hunter-level-block {
  position: relative;
  margin-bottom: 14px;
}
.hl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.hl-row-fine {
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}
.hl-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.hl-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.hl-num span {
  color: var(--accent-gold-bright);
  font-size: 22px;
}
.xp-bar-track {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-blue-bright) 50%, var(--accent-gold) 100%);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--accent-blue-glow);
}
.xp-bar-bonus {
  position: absolute;
  top: 0;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    rgba(251, 191, 36, 0.3),
    rgba(251, 191, 36, 0.3) 4px,
    rgba(251, 191, 36, 0.15) 4px,
    rgba(251, 191, 36, 0.15) 8px
  );
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.xp-next-bar-wrap {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  align-self: center;
  margin-right: 8px;
}
.xp-next-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--text-mute) 0%, var(--accent-blue) 100%);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.55;
}

.hl-next {
  margin-top: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-mute);
}

.hunter-quick-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.hq-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.hq-icon {
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
}
.hq-val {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}
.hq-lbl {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 9px;
  color: var(--text-mute);
  margin-top: 2px;
  letter-spacing: 0.05em;
}

/* ============================================================
   FORGE
   ============================================================ */
.forge-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(251, 191, 36, 0.04);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 10px;
  margin-bottom: 12px;
}
.forge-streak-block {
  display: flex;
  align-items: center;
  gap: 6px;
}
.streak-flame {
  font-size: 16px;
  filter: drop-shadow(0 0 6px var(--accent-gold-glow));
}
.streak-num {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}
.streak-lbl {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-dim);
}
.forge-mult-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.forge-mult-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.forge-mult-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}

.disciplines-grid {
  display: grid;
  gap: 8px;
}
.discipline-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.discipline-card.done {
  background: rgba(52, 211, 153, 0.06);
  border-color: rgba(52, 211, 153, 0.3);
}
.discipline-card:active {
  transform: scale(0.98);
}
.dc-checkbox {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.discipline-card.done .dc-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-void);
  font-weight: 700;
  box-shadow: 0 0 12px var(--success-glow);
}
.dc-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.dc-info {
  flex: 1;
  min-width: 0;
}
.dc-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.dc-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
  margin-top: 2px;
  letter-spacing: 0.05em;
}
.dc-streak {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  flex-shrink: 0;
  text-align: right;
}

.forge-history {
  margin-top: 14px;
}
.forge-history-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.forge-history-row {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 3px;
}
.fh-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  position: relative;
}
.fh-cell.perfect { background: var(--success); border-color: var(--success); box-shadow: 0 0 4px var(--success-glow); }
.fh-cell.partial { background: rgba(245, 158, 11, 0.5); border-color: var(--warning); }
.fh-cell.missed { background: rgba(239, 68, 68, 0.3); border-color: var(--danger); }
.fh-cell.future { opacity: 0.3; }
.fh-cell.today { outline: 2px solid var(--accent-gold-bright); outline-offset: 1px; }

.dungeon-banner {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1.5px solid var(--danger);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
  animation: pulse-danger 2.5s infinite ease-in-out;
}
@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 24px rgba(239, 68, 68, 0.4); }
}
.dungeon-icon {
  font-size: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px var(--danger-glow));
}
.dungeon-content {
  flex: 1;
}
.dungeon-title {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dungeon-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.45;
}

/* ============================================================
   SYNTH GRID
   ============================================================ */
.synth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.synth-item {
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}
.synth-lbl {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.synth-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}
.synth-val-sm {
  font-size: 13px;
  color: var(--accent-blue-bright);
}

/* ============================================================
   MISSIONS (Statut — tâches 3 jours)
   ============================================================ */
.missions-day-header {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 10px 0 5px;
}
.missions-day-header:first-child {
  margin-top: 0;
}
.missions-day-header strong {
  color: var(--accent-gold-bright);
  font-style: normal;
}
.mission-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 5px;
}
.mission-row.urgent { border-left: 3px solid var(--danger); }
.mission-row.haute { border-left: 3px solid var(--warning); }
.mission-row.moyenne { border-left: 3px solid var(--accent-gold-bright); }
.mission-row.basse { border-left: 3px solid var(--border-strong); }
.mission-row.overdue {
  background: rgba(239, 68, 68, 0.06);
}
.mission-info {
  flex: 1;
  min-width: 0;
}
.mission-title {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mission-meta {
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  color: var(--text-mute);
  margin-top: 2px;
}
.mission-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-blue-bright);
  flex-shrink: 0;
}

/* ============================================================
   ARBRE DES PROJETS
   ============================================================ */
.card-arbre { padding-bottom: 4px; }
.arbre-refresh-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-mute);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.arbre-refresh-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.arbre-tree-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 0 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.arbre-tree-wrap::-webkit-scrollbar { height: 4px; }
.arbre-tree-wrap::-webkit-scrollbar-track { background: transparent; }
.arbre-tree-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.arbre-loading {
  padding: 20px; text-align: center;
  font-size: 11px; color: var(--text-mute);
  font-family: 'JetBrains Mono', monospace;
}
.arbre-error {
  padding: 14px 16px; font-size: 11px;
  color: #ef4444; font-family: 'JetBrains Mono', monospace; line-height: 1.6;
}

/* Stats bar */
.arbre-stats-bar {
  display: flex; gap: 12px;
  padding: 0 4px 10px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  white-space: nowrap;
}
.arbre-stat-chip { font-size: 12px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.arbre-stat-chip span {
  font-size: 9px; font-weight: 500; color: var(--text-mute);
  font-family: 'DM Sans', sans-serif; margin-left: 2px;
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* Tree */
.arbre-tree { min-width: 620px; }

/* Category section */
.arbre-cat-section { margin-bottom: 14px; }
.arbre-cat-label {
  display: flex; align-items: center; gap: 7px;
  padding: 2px 4px 7px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-mute);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 5px; white-space: nowrap;
}
.arbre-cat-pip { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.arbre-cat-count-badge {
  margin-left: auto; font-size: 9px;
  background: rgba(255,255,255,0.06); padding: 1px 5px;
  border-radius: 9px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

/* Sub-section (e.g. Samsung under CA Consulting) */
.arbre-sub-section { margin-bottom: 4px; }
.arbre-sub-label {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 4px 5px 10px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 3px;
}
.arbre-sub-pip { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.arbre-sub-section .arbre-pcard { margin-left: 8px; }

/* Project card */
.arbre-pcard { margin-bottom: 3px; border-radius: 6px; overflow: hidden; }

/* Project header row */
.arbre-pcard-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.025);
  border-left: 3px solid transparent;
  cursor: pointer; user-select: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.arbre-pcard-hdr:hover { background: rgba(255,255,255,0.045); }

.arbre-chev {
  font-size: 8px; color: var(--text-mute);
  transition: transform 0.2s; flex-shrink: 0;
  display: inline-block; width: 10px;
}
.arbre-pcard.open > .arbre-pcard-hdr .arbre-chev { transform: rotate(90deg); }

.arbre-pcard-name {
  font-size: 12.5px; font-weight: 600;
  color: var(--text); flex: 1; min-width: 120px;
}

/* Status badge */
.arbre-sbadge {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 3px; flex-shrink: 0;
}
.arbre-sbadge.actif   { background: rgba(34,197,94,0.15);   color: #22c55e; }
.arbre-sbadge.attente { background: rgba(234,179,8,0.15);   color: #eab308; }
.arbre-sbadge.bloque  { background: rgba(239,68,68,0.15);   color: #ef4444; }
.arbre-sbadge.termine { background: rgba(139,139,139,0.15); color: #8b8b8b; }
.arbre-sbadge.idee    { background: rgba(167,139,250,0.15); color: #a78bfa; }

/* Priority */
.arbre-prio { font-size: 11px; flex-shrink: 0; }
.arbre-prio.urgente { color: #ef4444; font-weight: 600; }
.arbre-prio.haute   { color: #f97316; }

/* Progress row (inside header) */
.arbre-prog-row { display: flex; align-items: center; gap: 5px; width: 110px; flex-shrink: 0; }
.arbre-prog-track { flex: 1; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.arbre-prog-fill  { height: 100%; border-radius: 2px; transition: width 0.4s; }
.arbre-prog-pct   { font-size: 11px; font-weight: 700; width: 30px; text-align: right; font-family: 'JetBrains Mono', monospace; }

/* Deadline */
.arbre-pdl { font-size: 11px; color: var(--text-mute); flex-shrink: 0; font-family: 'JetBrains Mono', monospace; }
.arbre-pdl.overdue { color: #ef4444; font-weight: 700; }

/* Description (shown when open) */
.arbre-pcard-desc {
  font-size: 11px; color: var(--text-mute); font-style: italic;
  padding: 4px 10px 6px 22px;
  background: rgba(255,255,255,0.015);
  border-left: 3px solid transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: none; line-height: 1.4;
}
.arbre-pcard.open .arbre-pcard-desc { display: block; }

/* Tasks container (shown when open) */
.arbre-pcard-tasks {
  display: none;
  background: rgba(255,255,255,0.012);
  border-left: 3px solid transparent;
  padding: 3px 0 7px 0;
}
.arbre-pcard.open .arbre-pcard-tasks { display: block; }

/* Task row */
.arbre-task-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 14px;
  font-size: 12px; white-space: nowrap;
  transition: background 0.1s;
}
.arbre-task-row:hover { background: rgba(255,255,255,0.02); }
.arbre-tconn { font-family: 'JetBrains Mono', monospace; color: var(--text-mute); opacity: 0.35; flex-shrink: 0; font-size: 12px; }
.arbre-ticon { flex-shrink: 0; font-size: 12px; }
.arbre-tname { color: rgba(255,255,255,0.82); flex: 1; }
.arbre-tname.done { text-decoration: line-through; color: var(--text-mute); opacity: 0.6; }
.arbre-tdl { font-size: 10px; color: var(--text-mute); flex-shrink: 0; font-family: 'JetBrains Mono', monospace; }
.arbre-tdl.overdue { color: #ef4444; }

/* ============================================================
   DIRECTIVES DU CHASSEUR
   ============================================================ */
.card-directives {
  border-color: rgba(99, 102, 241, 0.25);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, var(--bg-card) 100%);
}
.directives-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--accent-blue-bright);
  opacity: 0.6;
  margin-top: 2px;
}
.directives-count-meta {
  color: var(--accent-blue-bright) !important;
}
.directives-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.directives-input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}
.directives-input::placeholder {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-faint);
  font-size: 13px;
}
.directives-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}
.directives-add-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-bright) 100%);
  border-radius: 10px;
  font-size: 22px;
  font-weight: 300;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--accent-blue-glow);
  transition: transform 0.15s ease;
}
.directives-add-btn:active {
  transform: scale(0.94);
}
.directive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s ease;
}
.directive-row:last-child {
  border-bottom: none;
}
.directive-row.done {
  opacity: 0.38;
}
.directive-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--bg-void);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}
.directive-row.done .directive-check {
  background: var(--accent-blue-bright);
  border-color: var(--accent-blue-bright);
  box-shadow: 0 0 8px var(--accent-blue-glow);
}
.directive-text {
  flex: 1;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}
.directive-row.done .directive-text {
  text-decoration: line-through;
  color: var(--text-faint);
}
.directive-del {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.15s ease;
}
.directive-row:hover .directive-del,
.directive-row:active .directive-del {
  opacity: 1;
}
.directive-del:active {
  color: var(--danger);
}
.directives-empty {
  padding: 18px 0 6px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ============================================================
   STATS — redesign v6
   ============================================================ */
.stats-grid {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.stat-card {
  position: relative;
  padding: 14px 14px 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--stat-color, var(--accent-blue));
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left,
    var(--stat-glow, rgba(99,102,241,0.08)) 0%, transparent 65%);
  pointer-events: none;
}
.stat-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.stat-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--stat-glow, rgba(99,102,241,0.12));
  border: 1.5px solid var(--stat-color, var(--accent-blue));
  box-shadow: 0 0 14px var(--stat-glow, rgba(99,102,241,0.2));
  flex-shrink: 0;
}
.stat-meta {
  flex: 1;
  min-width: 0;
}
.stat-name {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  line-height: 1.2;
}
.stat-domain {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-value-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--stat-color, var(--accent-gold-bright));
  text-shadow: 0 0 18px var(--stat-glow, rgba(251,191,36,0.5));
}
.stat-tier {
  font-family: 'Cinzel', serif;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stat-color, var(--text-mute));
  opacity: 0.65;
  margin-top: 2px;
  text-align: right;
}
.stat-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.stat-bar-fill {
  height: 100%;
  background: var(--stat-color, var(--accent-blue));
  border-radius: 3px;
  box-shadow: 0 0 8px var(--stat-glow, rgba(99,102,241,0.4));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-breakdown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.stat-bonus { color: var(--success); }
.stat-malus  { color: var(--danger); }

/* Allocator */
.allocator-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  margin-bottom: 14px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.alloc-points-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}
.allocator-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.alloc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.alloc-name {
  flex: 1;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.alloc-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.alloc-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-strong);
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}
.alloc-btn:disabled {
  opacity: 0.3;
  color: var(--text-mute);
}
.alloc-val {
  width: 28px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
}

/* ============================================================
   CONSTELLATION
   ============================================================ */
.constellation-wrap {
  position: relative;
  z-index: 2;
  background:
    radial-gradient(ellipse at top right, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(167, 139, 250, 0.07) 0%, transparent 50%),
    rgba(10, 14, 21, 0.5);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 14px;
}
.constellation-svg {
  width: 100%;
  height: auto;
  display: block;
}
.constellation-footer {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.const-star { cursor: pointer; }
.const-star:active { opacity: 0.7; }

.dream-list {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.dream-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dream-card:active {
  background: var(--bg-card-hover);
  transform: scale(0.99);
}
.dream-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.dream-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.dream-card-icon {
  font-size: 18px;
}
.dream-card-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}
.dream-card-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.dream-card-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.dream-card-meta {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
}

/* ============================================================
   JALONS DETAIL (modal)
   ============================================================ */
.jalons-detail {
  padding: 4px;
}
.jalons-detail-header {
  text-align: center;
  margin-bottom: 16px;
}
.jalons-icon-big {
  font-size: 48px;
  filter: drop-shadow(0 0 16px var(--accent-blue-glow));
  margin-bottom: 8px;
}
.jalons-dream-name {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.jalons-dream-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}
.jalons-progress {
  margin: 16px 0;
  padding: 10px 14px;
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  text-align: center;
}
.jalons-progress-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}
.jalons-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.jalons-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-gold) 100%);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.jalons-pillar {
  margin-bottom: 12px;
}
.jalons-pillar-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--accent-blue-bright);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.jalon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.jalon-row.validated {
  background: rgba(52, 211, 153, 0.06);
  border-color: rgba(52, 211, 153, 0.3);
}
.jalon-row:active { transform: scale(0.99); }
.jalon-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.jalon-row.validated .jalon-check {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-void);
  font-weight: 700;
}
.jalon-name {
  flex: 1;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}
.jalon-row.validated .jalon-name {
  text-decoration: line-through;
  color: var(--text-dim);
}
.jalon-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--accent-gold-bright);
  flex-shrink: 0;
}

/* ============================================================
   TROPHÉES
   ============================================================ */
.trophies-counter {
  text-align: center;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 12px;
}
.tc-num {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-gold-bright);
}
.tc-sep {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--text-mute);
  margin: 0 4px;
}
.tc-tot {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--text-dim);
}
.tc-lbl {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.trophies-wrap {
  display: grid;
  gap: 14px;
}
.trophies-section {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--accent-gold-bright);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.trophies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.trophy {
  aspect-ratio: 0.85;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.trophy.unlocked {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(251, 191, 36, 0.08) 100%);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}
.trophy.unlocked .trophy-icon {
  filter: drop-shadow(0 0 6px var(--accent-gold-glow));
}
.trophy.locked .trophy-icon {
  filter: grayscale(1) opacity(0.3);
}
.trophy:active { transform: scale(0.95); }
.trophy-icon {
  font-size: 26px;
  margin-bottom: 4px;
}
.trophy-name {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--text);
}
.trophy.locked .trophy-name {
  color: var(--text-faint);
}
.trophy-revoke-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(255, 68, 68, 0.12);
  border: 1px solid rgba(255, 68, 68, 0.35);
  border-radius: 50%;
  color: rgba(255, 68, 68, 0.7);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}
.trophy-revoke-btn:active {
  background: rgba(255, 68, 68, 0.35);
}
.trophies-hint {
  text-align: center;
  margin-top: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-mute);
}

/* ============================================================
   QUÊTES
   ============================================================ */
.quetes-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}
.qm-pill {
  padding: 12px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.qm-pill-reserve {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(251, 191, 36, 0.06) 100%);
}
.qm-lbl {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 10px;
  color: var(--text-mute);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.qm-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-gold-bright);
}

.qa-form {
  display: grid;
  gap: 10px;
}
.qa-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: -4px;
}
.qa-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qa-preset {
  padding: 6px 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  transition: all 0.15s ease;
}
.qa-preset:active {
  background: var(--accent-blue-glow);
  color: var(--accent-blue-bright);
  border-color: var(--accent-blue);
}
.qa-input, .qa-select {
  width: 100%;
  padding: 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 16px; /* ≥16px évite le zoom auto iOS qui bloque le focus */
  outline: none;
  transition: border-color 0.2s ease;
}
.qa-input:focus, .qa-select:focus {
  border-color: var(--accent-blue);
}
.qa-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 5l3 3 3-3' stroke='%23818cf8' stroke-width='1.5' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.quetes-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.quete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.quete-icon {
  font-size: 18px;
}
.quete-info {
  flex: 1;
  min-width: 0;
}
.quete-name {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quete-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-mute);
  margin-top: 2px;
}
.quete-xp {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  flex-shrink: 0;
}

.empty-state {
  padding: 30px 16px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text-mute);
}

/* ============================================================
   TAB BAR (bottom)
   ============================================================ */
.tab-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  padding: 8px 4px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(6, 8, 13, 0.95);
  backdrop-filter: blur(12px);
  z-index: 10;
}
.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
  position: relative;
  min-width: 56px;
}
.tab-btn.active {
  color: var(--accent-blue-bright);
}
.tab-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--accent-blue-bright);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--accent-blue-glow);
}
.tab-icon {
  font-size: 20px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-bright) 100%);
  color: white;
  box-shadow: 0 0 14px var(--accent-blue-glow);
}
.btn-warning {
  background: linear-gradient(135deg, var(--danger) 0%, var(--warning) 100%);
  color: white;
  box-shadow: 0 0 12px var(--danger-glow);
}
.btn-ghost {
  background: var(--bg-card);
  color: var(--text-dim);
  border-color: var(--border-strong);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  background: linear-gradient(180deg, rgba(15, 20, 29, 0.98) 0%, rgba(10, 14, 21, 1) 100%);
  border: 1.5px solid var(--accent-gold);
  border-radius: 16px;
  box-shadow: 0 0 36px var(--accent-gold-glow), inset 0 0 24px rgba(251, 191, 36, 0.04);
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.locked {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.5);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-content {
  padding: 20px 18px;
}

/* Trophy modal styling */
.tp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.tp-system {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--accent-gold-bright);
  letter-spacing: 0.2em;
}
.modal.locked .tp-system {
  color: var(--text-mute);
}
.tp-close {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-dim);
}
.tp-icon-wrap {
  text-align: center;
  margin: 4px 0 8px;
}
.tp-icon {
  font-size: 64px;
  display: inline-block;
}
.tp-icon.unlocked {
  filter: drop-shadow(0 0 22px var(--accent-gold-glow));
  animation: pulse-gold 3s infinite ease-in-out;
}
.tp-icon.locked {
  filter: grayscale(1) opacity(0.4);
}
.tp-status {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  letter-spacing: 0.2em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.modal.locked .tp-status {
  color: var(--text-mute);
}
.tp-name {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.modal.locked .tp-name {
  color: var(--text-dim);
}
.tp-narrative {
  padding: 14px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid var(--accent-gold-bright);
  border-radius: 4px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  text-align: left;
  margin-bottom: 14px;
}
.modal.locked .tp-narrative {
  border-left-color: var(--text-mute);
}
.tp-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.tp-meta-card {
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}
.tp-meta-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 9px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}
.tp-meta-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-gold-bright);
  font-weight: 700;
}
.tp-meta-val.condition {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  color: var(--accent-blue-bright);
}
.tp-reward {
  padding: 12px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(212, 165, 116, 0.04) 100%);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  text-align: center;
}
.modal.locked .tp-reward {
  background: rgba(99, 102, 241, 0.04);
  border: 1px dashed rgba(99, 102, 241, 0.2);
}
.tp-reward-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  color: var(--accent-gold-bright);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.modal.locked .tp-reward-label {
  color: var(--accent-blue-bright);
}
.tp-reward-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

/* ============================================================
   LEVEL UP
   ============================================================ */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.levelup-overlay.active {
  display: flex;
  animation: fadeIn 0.4s ease;
}
.levelup-modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 24px 20px;
  background: linear-gradient(180deg, rgba(15, 20, 29, 0.98) 0%, rgba(10, 14, 21, 1) 100%);
  border: 1.5px solid var(--accent-gold-bright);
  border-radius: 16px;
  box-shadow: 0 0 60px var(--accent-gold-glow);
  text-align: center;
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.levelup-aura {
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, var(--accent-gold-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: aura-rotate 8s linear infinite;
}
@keyframes aura-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.levelup-glyph {
  position: relative;
  font-size: 64px;
  filter: drop-shadow(0 0 24px var(--accent-gold-glow));
  margin-bottom: 8px;
  animation: pulse-gold 1.5s infinite ease-in-out;
}
.levelup-status {
  position: relative;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  letter-spacing: 0.25em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.levelup-name {
  position: relative;
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #fff 0%, var(--accent-gold-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}
.levelup-narrative {
  position: relative;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 20px;
}
.levelup-cta {
  position: relative;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-stack {
  position: fixed;
  top: calc(60px + var(--safe-top));
  left: 16px;
  right: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  background: rgba(15, 20, 29, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent-blue);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px var(--accent-blue-glow);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 13px;
}
.toast.gold {
  border-color: var(--accent-gold-bright);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px var(--accent-gold-glow);
}
.toast.danger {
  border-color: var(--danger);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px var(--danger-glow);
}
.toast.success {
  border-color: var(--success);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px var(--success-glow);
}
.toast-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-blue-bright);
  text-transform: uppercase;
}
.toast-body {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ============================================================
   NOTION TABS (PROJETS | TÂCHES | HUB)
   ============================================================ */
.notion-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.notion-tab {
  padding: 5px 12px;
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.notion-tab.active {
  color: var(--accent-blue-bright);
  border-color: var(--accent-blue);
  background: rgba(99,102,241,0.1);
}
.notion-panel {
  display: none;
}
.notion-panel.active {
  display: block;
}

/* ============================================================
   TÂCHES — Filter bar, toggle, task cards
   ============================================================ */
.s7-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.s7-filter-chip {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-family: 'Manrope', sans-serif;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.s7-filter-chip.active {
  background: rgba(99,102,241,0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue-bright);
}

.s7-tabs-group {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 2px;
  margin-bottom: 12px;
}
.s7-tab-group-btn {
  flex: 1;
  padding: 5px;
  text-align: center;
  font-size: 10px;
  font-family: 'Manrope', sans-serif;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.s7-tab-group-btn.active {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
}

.s7-day-header {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 10px 0 5px;
  padding-left: 4px;
}
.s7-day-header strong {
  color: var(--accent-gold-bright);
  font-style: normal;
  font-weight: 700;
}

.s7-task {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.25s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.s7-task.urgent {
  border-left: 3px solid var(--danger);
}
.s7-task.haute {
  border-left: 3px solid var(--warning);
}
.s7-task.moyenne {
  border-left: 3px solid var(--accent-gold-bright);
}
.s7-task.basse {
  border-left: 3px solid var(--border-strong);
}
.s7-task.done {
  opacity: 0.38;
}
.s7-task-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.s7-task.done .s7-task-check {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}
.s7-task.done .s7-task-check::after {
  content: '✓';
  font-size: 9px;
  color: white;
  font-weight: 700;
}
.s7-task-info {
  flex: 1;
  min-width: 0;
}
.s7-task-title {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
}
.s7-task.done .s7-task-title {
  text-decoration: line-through;
  color: var(--text-mute);
}
.s7-task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-mute);
  font-family: 'Manrope', sans-serif;
}
.s7-task-meta .xp-stat {
  color: var(--accent-blue-bright);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
}

.s7-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-mute);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 14px;
}

/* Hub links */
.hub-link {
  display: block;
  padding: 10px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--accent-blue-bright);
  text-decoration: none;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  transition: border-color 0.15s;
}
.hub-link:active {
  border-color: var(--accent-blue);
}

/* ============================================================
   SYNC INDICATOR (header cloud icon)
   ============================================================ */
.sync-indicator {
  position: relative;
}
.sync-icon {
  font-size: 14px;
  transition: opacity 0.3s ease;
}
.sync-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-void);
  background: var(--text-mute);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.sync-indicator[data-sync="synced"] .sync-dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success-glow);
}
.sync-indicator[data-sync="syncing"] .sync-dot {
  background: var(--accent-blue-bright);
  box-shadow: 0 0 6px var(--accent-blue-glow);
  animation: sync-pulse 1s infinite ease-in-out;
}
.sync-indicator[data-sync="dirty"] .sync-dot {
  background: var(--warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}
.sync-indicator[data-sync="error"] .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger-glow);
}
.sync-indicator[data-sync="offline"] .sync-dot {
  background: var(--text-faint);
}
@keyframes sync-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

/* Sync Notion indicator */
.notion-sync {
  display: none;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  margin: 0 0 8px 0;
  text-align: center;
  letter-spacing: 0.03em;
}
.notion-sync.loading {
  display: block;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
}
.notion-sync.ok {
  display: block;
  color: #34d399;
  background: rgba(52,211,153,0.08);
}
.notion-sync.offline {
  display: block;
  color: #fbbf24;
  background: rgba(251,191,36,0.08);
}
