/* ============================================================
   FRANCOPHONE ACADEMY — VIRTUAL FRENCH CITY 2.0 (design premium)
   Direction artistique : ville française contemporaine, 2.5D,
   palette nuit/bleu/violet/ivoire/or. SVG cohérents, animations
   légères, responsive, prefers-reduced-motion.
   ============================================================ */

:root {
  --vfc-night: #0a1428;
  --vfc-night-2: #0d1a33;
  --vfc-navy: #111f3d;
  --vfc-navy-2: #16274a;
  --vfc-blue: #2b5ce6;
  --vfc-blue-2: #4d7cff;
  --vfc-violet: #7c5cff;
  --vfc-gold: #f2c94c;
  --vfc-gold-2: #ffd76a;
  --vfc-ivory: #f4f1e8;
  --vfc-ink: #e9edf7;
  --vfc-muted: #93a3c4;
  --vfc-green: #34d17b;
  --vfc-red: #ff6b6b;
  --vfc-line: rgba(255, 255, 255, 0.08);
}

.vfc-shell, .vfc-shell * { box-sizing: border-box; }
.vfc-body { overflow-x: hidden; }
.vfc-npc-fr { overflow-wrap: anywhere; }

.vfc-shell {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--vfc-ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(43, 92, 230, 0.22), transparent 55%),
    linear-gradient(180deg, var(--vfc-night) 0%, var(--vfc-night-2) 100%);
  font-family: 'Inter', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}

/* ---------- En-tête ---------- */
.vfc-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 14px 22px; border-bottom: 1px solid var(--vfc-line);
  background: rgba(13, 26, 51, 0.7); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 40;
}
.vfc-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display, 'Fraunces', serif); font-weight: 700; font-size: 17px; color: var(--vfc-ivory); }
.vfc-brand .vfc-brand-mark { width: 30px; height: 30px; color: var(--vfc-gold); }
.vfc-brand span { color: var(--vfc-blue-2); }
.vfc-header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Disposition générale ---------- */
.vfc-body { flex: 1; max-width: 1180px; margin: 0 auto; width: 100%; padding: 18px; }

.vfc-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 60vh; color: var(--vfc-muted); }
.vfc-spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--vfc-line); border-top-color: var(--vfc-blue-2); animation: vfc-spin 0.8s linear infinite; }
@keyframes vfc-spin { to { transform: rotate(360deg); } }

/* ============================================================
   VILLE (écran principal)
   ============================================================ */
.vfc-city { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }

/* --- Panneau joueur --- */
.vfc-player {
  background: linear-gradient(180deg, var(--vfc-navy) 0%, var(--vfc-navy-2) 100%);
  border: 1px solid var(--vfc-line); border-radius: 18px; padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.vfc-player-head { display: flex; align-items: center; gap: 12px; }
.vfc-avatar {
  width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--vfc-blue), var(--vfc-violet));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(43, 92, 230, 0.35);
}
.vfc-avatar svg { width: 34px; height: 34px; color: #fff; }
.vfc-player-name { font-weight: 700; font-size: 15px; color: var(--vfc-ivory); }
.vfc-player-level { font-size: 12px; color: var(--vfc-gold); font-weight: 600; }
.vfc-xp-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--vfc-muted); }
.vfc-xp-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.vfc-xp-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--vfc-blue-2), var(--vfc-violet)); transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.vfc-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.vfc-badge-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  color: var(--vfc-gold-2); background: rgba(242, 201, 76, 0.12); border: 1px solid rgba(242, 201, 76, 0.3);
  border-radius: 999px; padding: 5px 10px;
}
.vfc-badge-chip svg { width: 14px; height: 14px; }
.vfc-player-empty { font-size: 12px; color: var(--vfc-muted); }

/* --- Barre d'objectifs / accès --- */
.vfc-side-panel {
  background: rgba(17, 31, 61, 0.6); border: 1px solid var(--vfc-line); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.vfc-side-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--vfc-muted); font-weight: 700; }
.vfc-objective { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--vfc-ink); padding: 8px; border-radius: 10px; background: rgba(255,255,255,0.03); }
.vfc-objective svg { width: 16px; height: 16px; color: var(--vfc-gold); flex-shrink: 0; }
.vfc-objective .vfc-obj-done { color: var(--vfc-green); }
.vfc-access-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--vfc-line); background: rgba(255,255,255,0.03); color: var(--vfc-ink);
  font-size: 13px; cursor: pointer; font-family: inherit; transition: background .15s, border-color .15s;
}
.vfc-access-btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.18); }
.vfc-access-btn svg { width: 16px; height: 16px; color: var(--vfc-blue-2); }

/* --- Carte de la ville (vivante, 2.5D) --- */
.vfc-map {
  position: relative; border-radius: 20px; overflow: hidden;
  min-height: 520px; border: 1px solid var(--vfc-line);
  background:
    radial-gradient(600px 260px at 50% 100%, rgba(43, 92, 230, 0.18), transparent 65%),
    linear-gradient(115deg, transparent 46%, rgba(255,255,255,0.03) 46%, rgba(255,255,255,0.03) 48%, transparent 48%),
    linear-gradient(65deg, transparent 44%, rgba(255,255,255,0.02) 44%, rgba(255,255,255,0.02) 46%, transparent 46%),
    linear-gradient(180deg, #122342 0%, #0c1830 100%);
}
.vfc-map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; flex-wrap: wrap; border-bottom: 1px solid var(--vfc-line); position: relative; z-index: 6; }
.vfc-map-title { font-family: var(--font-display, 'Fraunces', serif); font-size: 22px; color: var(--vfc-ivory); }
.vfc-map-sub { font-size: 12px; color: var(--vfc-muted); margin-top: 2px; }
.vfc-objective-banner { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(242,201,76,0.12); border: 1px solid rgba(242,201,76,0.35); color: var(--vfc-gold-2); font-size: 13px; font-weight: 600; }
.vfc-objective-banner svg { width: 16px; height: 16px; }
.vfc-objective-banner strong { color: var(--vfc-gold); }
.vfc-map-canvas { position: relative; min-height: 460px; }

/* --- Lieux (façades 2.5D) --- */
.vfc-place {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  border: none; background: none; padding: 0; font-family: inherit; color: var(--vfc-ink);
  transition: transform .2s cubic-bezier(0.22, 1, 0.36, 1); width: 122px;
}
.vfc-place:hover { transform: translate(-50%, -50%) scale(1.05); z-index: 5; }
.vfc-place-facade { display: block; width: 122px; }
.vfc-place-facade svg { width: 100%; height: auto; display: block; }
.vfc-place.available .vfc-place-facade { filter: drop-shadow(0 12px 26px rgba(43, 92, 230, 0.45)); }
.vfc-place.available:hover .vfc-place-facade { animation: vfc-float 1.6s ease-in-out infinite; }
.vfc-place.completed .vfc-place-facade { filter: drop-shadow(0 12px 22px rgba(242, 201, 76, 0.3)); }
.vfc-place.locked .vfc-place-facade { opacity: 0.45; filter: grayscale(0.75) drop-shadow(0 6px 12px rgba(0,0,0,0.3)); }
.vfc-place-name { font-size: 12px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,0.7); }
.vfc-place-tag {
  position: absolute; top: 2px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--vfc-gold); color: #1a2340; box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.vfc-place-tag svg { width: 13px; height: 13px; }
.vfc-place.locked .vfc-place-tag { background: var(--vfc-muted); }
.vfc-place.completed .vfc-place-tag { background: var(--vfc-green); color: #fff; }
@keyframes vfc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* --- Décor de la ville --- */
.vfc-decor { position: absolute; width: 26px; pointer-events: none; opacity: 0.95; }
.vfc-decor svg { width: 100%; height: auto; display: block; }
.vfc-player-on-map { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.vfc-player-on-map svg { width: 40px; height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.45)); }
.vfc-player-on-map-label { font-size: 10px; font-weight: 700; color: var(--vfc-gold); text-shadow: 0 1px 3px rgba(0,0,0,0.7); }

/* --- Notification --- */
.vfc-toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--vfc-navy-2); border: 1px solid rgba(242, 201, 76, 0.4); border-radius: 14px;
  color: var(--vfc-ink); font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45); animation: vfc-toast-in .3s ease;
}
.vfc-toast svg { width: 18px; height: 18px; color: var(--vfc-gold); }
@keyframes vfc-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   LIEU / MISSION
   ============================================================ */
.vfc-zone { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.vfc-scene {
  position: relative; border-radius: 20px; overflow: hidden; min-height: 480px;
  border: 1px solid var(--vfc-line);
  background:
    radial-gradient(420px 220px at 72% 0%, rgba(124, 92, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #182a4d 0%, #101c37 100%);
}
.vfc-storefront-art { position: absolute; right: 5%; top: 11%; width: 46%; max-width: 340px; }
.vfc-storefront-art svg { width: 100%; height: auto; filter: drop-shadow(0 16px 30px rgba(0,0,0,0.45)); }
.vfc-scene-character { position: absolute; left: 24%; transform: translateX(-50%); bottom: 20%; text-align: center; z-index: 3; }
.vfc-scene-character svg { width: 120px; height: auto; filter: drop-shadow(0 12px 20px rgba(0,0,0,0.45)); }
.vfc-scene-name { font-weight: 700; color: var(--vfc-ivory); margin-top: 2px; }
.vfc-scene-role { font-size: 12px; color: var(--vfc-muted); }
.vfc-scene-sign { position: absolute; top: 16px; left: 16px; background: var(--vfc-navy); border: 1px solid var(--vfc-line); color: var(--vfc-ivory); font-weight: 700; border-radius: 10px; padding: 8px 14px; z-index: 4; display: flex; align-items: center; gap: 8px; }
.vfc-scene-sign svg { width: 16px; height: 16px; color: var(--vfc-gold); }
.vfc-scene-hint { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--vfc-ink); background: rgba(17,31,61,0.88); border: 1px solid var(--vfc-line); border-radius: 12px; padding: 10px 14px; }
.vfc-scene-hint svg { width: 16px; height: 16px; color: var(--vfc-gold); flex-shrink: 0; }
.vfc-scene-objects { position: absolute; left: 12px; right: 12px; bottom: 64px; display: flex; justify-content: center; gap: 8px; z-index: 3; flex-wrap: wrap; }
.vfc-object {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(17,31,61,0.85); border: 1px solid var(--vfc-line); border-radius: 12px;
  padding: 8px 10px; cursor: pointer; color: var(--vfc-ink); font-family: inherit;
  transition: transform .15s, border-color .15s;
}
.vfc-object:hover { transform: translateY(-3px); border-color: rgba(77,124,255,0.5); }
.vfc-object svg { width: 22px; height: 22px; color: var(--vfc-gold); }
.vfc-object-label { font-size: 11px; color: var(--vfc-muted); }
.vfc-story-card { display: flex; gap: 10px; align-items: flex-start; background: rgba(124,92,255,0.1); border: 1px solid rgba(124,92,255,0.25); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.vfc-story-card svg { width: 18px; height: 18px; color: var(--vfc-violet); flex-shrink: 0; margin-top: 2px; }
.vfc-story-card p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--vfc-ink); }
.vfc-story-card strong { color: var(--vfc-gold); }

.vfc-mission-card { background: linear-gradient(180deg, var(--vfc-navy), var(--vfc-navy-2)); border: 1px solid var(--vfc-line); border-radius: 16px; padding: 16px; }
.vfc-mission-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.vfc-mission-level { font-size: 11px; font-weight: 800; color: #fff; background: var(--vfc-violet); border-radius: 6px; padding: 3px 8px; }
.vfc-mission-title { font-weight: 700; color: var(--vfc-ivory); font-size: 15px; }
.vfc-objective { font-size: 13px; color: var(--vfc-muted); line-height: 1.5; margin-bottom: 14px; }

/* --- Dialogue --- */
.vfc-mission { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.vfc-progress { display: flex; align-items: center; gap: 10px; }
.vfc-progress-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.vfc-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--vfc-blue-2), var(--vfc-violet)); transition: width .4s ease; }
.vfc-progress-label { font-size: 12px; color: var(--vfc-muted); font-weight: 600; white-space: nowrap; }

.vfc-dialogue { display: flex; gap: 14px; align-items: flex-start; }
.vfc-dialogue .vfc-npc { flex-shrink: 0; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--vfc-navy-2), var(--vfc-navy)); border: 1px solid var(--vfc-line); display: flex; align-items: center; justify-content: center; }
.vfc-dialogue .vfc-npc svg { width: 40px; height: 40px; color: var(--vfc-gold); }
.vfc-bubble {
  flex: 1; background: rgba(17,31,61,0.75); border: 1px solid var(--vfc-line); border-radius: 16px 16px 16px 4px; padding: 14px 16px;
  animation: vfc-rise .35s ease;
}
.vfc-npc-name { font-size: 12px; font-weight: 700; color: var(--vfc-gold); margin-bottom: 6px; }
.vfc-npc-fr { font-size: 18px; font-weight: 600; color: var(--vfc-ivory); line-height: 1.4; }
.vfc-npc-en { font-size: 13px; color: var(--vfc-muted); margin-top: 4px; }

.vfc-instruction {
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--vfc-ink);
  background: rgba(124,92,255,0.12); border: 1px solid rgba(124,92,255,0.25); border-radius: 12px; padding: 10px 14px;
}
.vfc-instruction svg { width: 16px; height: 16px; color: var(--vfc-violet); }

.vfc-choices { display: flex; flex-direction: column; gap: 10px; }
.vfc-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(17,31,61,0.6); border: 1px solid var(--vfc-line); border-radius: 14px;
  padding: 13px 16px; cursor: pointer; text-align: left; font-family: inherit; color: var(--vfc-ink);
  transition: background .15s, border-color .15s, transform .15s;
  min-width: 0;
}
.vfc-choice:hover { background: rgba(43,92,230,0.16); border-color: rgba(77,124,255,0.5); transform: translateX(3px); }
.vfc-choice > span:first-child { min-width: 0; }
.vfc-choice .vfc-choice-fr { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; word-break: break-word; }
.vfc-choice .vfc-choice-en { font-size: 12px; color: var(--vfc-muted); margin-top: 2px; overflow-wrap: anywhere; }
.vfc-choice .vfc-choice-lang { font-size: 11px; color: var(--vfc-gold); font-weight: 700; flex-shrink: 0; }

.vfc-feedback { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 12px 14px; font-size: 14px; animation: vfc-rise .3s ease; }
.vfc-feedback.ok { background: rgba(52,209,123,0.12); border: 1px solid rgba(52,209,123,0.35); color: #b9f2d2; }
.vfc-feedback.err { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.35); color: #ffd0d0; }
.vfc-feedback svg { width: 18px; height: 18px; flex-shrink: 0; }

.vfc-speak {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; border: 1px solid rgba(77,124,255,0.5); background: rgba(43,92,230,0.18);
  color: var(--vfc-blue-2); cursor: pointer; vertical-align: middle; margin-left: 6px;
}
.vfc-speak svg { width: 14px; height: 14px; }
.vfc-speak:hover { background: rgba(43,92,230,0.3); }

/* --- Résultat --- */
.vfc-result { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 640px; margin: 0 auto; text-align: center; }
.vfc-result-badge { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--vfc-gold), #e0a63a); box-shadow: 0 14px 40px rgba(242,201,76,0.4); animation: vfc-badge-pop .6s cubic-bezier(0.22, 1.4, 0.36, 1); }
.vfc-result-badge svg { width: 48px; height: 48px; color: #1a2340; }
@keyframes vfc-badge-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.vfc-result-title { font-family: var(--font-display, 'Fraunces', serif); font-size: 26px; color: var(--vfc-ivory); }
.vfc-result-badge-name { font-size: 15px; font-weight: 700; color: var(--vfc-gold); }
.vfc-result-xp { font-size: 22px; font-weight: 800; color: var(--vfc-blue-2); }
.vfc-result-stats { font-size: 13px; color: var(--vfc-muted); }
.vfc-result-expressions { width: 100%; background: rgba(17,31,61,0.7); border: 1px solid var(--vfc-line); border-radius: 16px; padding: 16px; }
.vfc-result-expressions h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--vfc-muted); margin-bottom: 10px; }
.vfc-expr { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--vfc-line); text-align: left; }
.vfc-expr:last-child { border-bottom: none; }
.vfc-expr .vfc-expr-fr { font-weight: 600; color: var(--vfc-ivory); }
.vfc-expr .vfc-expr-en { font-size: 12px; color: var(--vfc-muted); }
.vfc-result-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   Boutons / utilitaires
   ============================================================ */
.vfc-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .15s, border-color .15s;
}
.vfc-btn-primary { background: linear-gradient(135deg, var(--vfc-blue), var(--vfc-violet)); color: #fff; box-shadow: 0 8px 22px rgba(43,92,230,0.4); }
.vfc-btn-primary:hover { transform: translateY(-1px); }
.vfc-btn-ghost { background: rgba(255,255,255,0.04); color: var(--vfc-ink); border-color: var(--vfc-line); }
.vfc-btn-ghost:hover { background: rgba(255,255,255,0.08); }
.vfc-btn svg { width: 16px; height: 16px; }

/* ---------- Animations ---------- */
@keyframes vfc-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes vfc-fade { from { opacity: 0; } to { opacity: 1; } }
.vfc-fade-in { animation: vfc-fade .3s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .vfc-city { grid-template-columns: 1fr; }
  .vfc-player { order: 2; }
  .vfc-map { order: 1; min-height: 420px; }
  .vfc-zone { grid-template-columns: 1fr; }
  .vfc-scene { min-height: 360px; }
}

@media (max-width: 560px) {
  .vfc-body { padding: 10px; }
  .vfc-map { min-height: 0; }
  .vfc-map-canvas { min-height: 420px; }
  .vfc-map-head { padding: 12px; }
  .vfc-map-title { font-size: 18px; }
  .vfc-objective-banner { font-size: 11px; padding: 6px 10px; }
  .vfc-place { width: 84px; }
  .vfc-place-facade { width: 84px; }
  .vfc-place-name { font-size: 10px; }
  .vfc-place-tag { width: 18px; height: 18px; }
  .vfc-place-tag svg { width: 11px; height: 11px; }
  .vfc-scene { min-height: 460px; }
  .vfc-storefront-art { width: 58%; right: -4%; }
  .vfc-scene-character { left: 22%; }
  .vfc-scene-character svg { width: 84px; }
  .vfc-scene-hint { font-size: 12px; }
  .vfc-npc-fr { font-size: 16px; }
  .vfc-choice .vfc-choice-fr { font-size: 14px; }
  .vfc-result-title { font-size: 22px; }
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .vfc-shell *, .vfc-shell *::before, .vfc-shell *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
